Skip to content

Conversation

push2stack
Copy link
Contributor

No description provided.

Ramadevie and others added 10 commits September 5, 2025 20:55
commit bc517d2
Author: Kalpesh Palav <[email protected]>
Date:   Thu Sep 18 18:13:11 2025 +0100

    lint warning fixes

commit 5573158
Author: Kalpesh Palav <[email protected]>
Date:   Thu Sep 18 18:05:43 2025 +0100

    empty resource fix

commit bcb45c1
Author: Kalpesh Palav <[email protected]>
Date:   Thu Sep 18 17:32:31 2025 +0100

    Pagination logic implementation

commit 1feb08a
Author: Kalpesh Palav <[email protected]>
Date:   Thu Sep 18 16:49:25 2025 +0100

    lint warning fix

commit b75b5a6
Author: Kalpesh Palav <[email protected]>
Date:   Thu Sep 18 16:38:57 2025 +0100

    tdqm dependecy

commit 05ebbe3
Author: Kalpesh Palav <[email protected]>
Date:   Thu Sep 18 16:35:37 2025 +0100

    tqdm dependency added in pyproject

commit 6ce2fab
Author: Kalpesh Palav <[email protected]>
Date:   Thu Sep 18 15:50:32 2025 +0100

    fix progress bar issue with tdqm
commit 7f2853f
Author: Kalpesh Palav <[email protected]>
Date:   Wed Sep 17 16:50:14 2025 +0100

    fix to remove extra whitespace from output

commit d009ef3
Author: Kalpesh Palav <[email protected]>
Date:   Wed Sep 17 14:51:58 2025 +0100

    fix cat and _cat functions
Squashed commit of the following:

commit c8be4f7
Author: Kalpesh Palav <[email protected]>
Date:   Thu Sep 18 15:50:32 2025 +0100

    Pagination logic and download progress bar issue fix

    fix progress bar issue with tdqm
    tqdm dependency added in pyproject
    lint warning fix
    Pagination logic implementation
    empty resource fix
    lint warning fixes

PR review changes

lint warning fix for types

lint fixes

version update to 3.0.2-dev0
Fix cat/_cat functions | pagination logic support | download progress bar issue
# Required at create-time (optional at init-time for handles)
providerNode: dict[str, str] | None = None
consumerNode: dict[str, str] | None = None
# --- revert fix 1: camelCase field names restored ---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change this comment

client: Fusion | None = None,
return_resp_obj: bool = False,
) -> requests.Response | None:
"""Update this report using HTTP PUT with the current object state.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove HTTP PUT in the docstring

client: Fusion | None = None,
return_resp_obj: bool = False,
) -> requests.Response | None:
"""Partially update this report using HTTP PATCH.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove http patch

payload["regulatoryRelated"] = v
continue

# flat "publisher_node_identifier" -> nested publisherNode.publisherNodeIdentifier
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the commented line

{
"providerNode": {"name": "CRM_DB", "nodeType": "Database"},
"consumerNode": {"name": "DWH", "nodeType": "Database"},
"providerNode": {"name": "CRM_DB", "type": "Database"}, # was nodeType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove was Nodetype comment

providerNode: dict[str, str] | None = None
consumerNode: dict[str, str] | None = None
# --- camelCase field names (kept as-is) ---
providerNode: dict[str, Any] | None = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change it back to dict[str,str] for both providerNode and consumerNode to follow API

Attributes:
providerNode (dict[str, str] | None):
providerNode (dict[str, Any] | None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change comments also to dict[str,str]

Server-assigned unique identifier of the data flow. Must be set on the object for
``update()``, ``update_fields()``, and ``delete()``. Defaults to ``None``.
alternativeId (dict[str, Any] | None, optional):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this field as it does not exist on API

boundarySets (list[dict[str, Any]], optional):
Boundary set objects for the data flow; items are stored as provided. Defaults to empty list.
datasets (list[dict[str, Any]], optional):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove data assets from description

def from_dict(cls: type[Dataflow], data: dict[str, Any]) -> Dataflow:
"""Create a Dataflow object from a dictionary.
Accepts camelCase or snake_case keys and normalizes empty strings to None.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add back Args and Returns in docstring

forbidden = {"provider_node", "consumer_node"}
normalized = {camel_to_snake(k): v for k, v in changes.items()}
used = forbidden.intersection(normalized.keys())
# forbid changing nodes via PATCH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this commented line

)

patch_body = {snake_to_camel(k): v for k, v in normalized.items()}
# normalize empty strings to None recursively, keep keys camelCase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate code


patch_body = {snake_to_camel(k): v for k, v in normalized.items()}
# normalize empty strings to None recursively, keep keys camelCase
def normalize_value(val: Any) -> Any:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

call these in post_init()

- mnpi_indicator (bool)
- country_of_reporting_obligation (str)
- primary_regulator (str)
description (str | None): Description of the report.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the docstring for those required fields

provider_node: dict[str, str] | None = None,
consumer_node: dict[str, str] | None = None,
description: str | None = None,
alternative_id: dict[str, Any] | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be removed as no longer exist in API

Kalpesh-Palav and others added 2 commits October 2, 2025 11:28
lint fixes

Unit tests and lint fixes

changed elements to attributes

refactoring and lint fixes

Version update to 3.0.3-dev0

removing id from def create payload

added 'id' in fusion report_attribute

lint errors fix

removing title from def update

unit test fix

extra check validation removed

fix return dataframe in test_list_report_KDEs

test fix

payload fix

title parameter changed to optional

lint fixes

fix payload for update_fields

lint warning fixes

version revert, removed KDE method

fix get dataset from_catalog function for catalogs with no products

lint warning fix

fix exception message, align with pyfusion 3.7

tags issue solved

test fix

Report attribute arguments camel case fix to snake case
@push2stack push2stack force-pushed the feature/bcbs-updates1 branch from fa8af4e to 80cfb3b Compare October 2, 2025 15:47
@push2stack push2stack changed the base branch from master to release/20250905 October 2, 2025 15:48
)

patch_body = {snake_to_camel(k): v for k, v in normalized.items()}
def clean(v: Any) -> Any:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do this? it should be done on post_init()

return_resp_obj: bool = False,
) -> requests.Response | None:
"""Partial update (PATCH) using self.id. Provider/consumer nodes are not allowed."""
"""Partial update using id.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove changes parameter, use fields from Dataflow


def convert_keys(d: dict[str, Any]) -> dict[str, Any]:
converted = {}
converted: dict[str, Any] = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need this, it should be directly converted from camel to snake, then modify the dict just replace isBCBS239Program

... )
>>> payload = report.to_dict()
"""
def _camelize(obj: Any) -> Any:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. change the parameter name to have BCBS as upper case, and ignore it for conversion, then all this logic is not necessary, directly snake_to_camel function canb e used
  2. Or use sanke_to_camel and replace this parameter in response dict.

client = self._use_client(client)
payload = self.to_dict()

def _strip_ids(x: Any) -> Any:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be moved to post_init()?


def update_fields(
self,
fields_to_update: dict[str, Any],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this, and use the object to update

resp: requests.Response = client.session.post(url, json=data)
payload: dict[str, Any] = {}
for k, v in fields_to_update.items():
sk = camel_to_snake(k)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use to_dict()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants