-
Notifications
You must be signed in to change notification settings - Fork 22
bcbs updates #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/20250905
Are you sure you want to change the base?
bcbs updates #154
Conversation
release/20250905
Update LICENSE
Bump version
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
This reverts commit f9c8755.
This reverts commit 437a209.
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
py_src/fusion/dataflow.py
Outdated
# 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 --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change this comment
py_src/fusion/report.py
Outdated
client: Fusion | None = None, | ||
return_resp_obj: bool = False, | ||
) -> requests.Response | None: | ||
"""Update this report using HTTP PUT with the current object state. |
There was a problem hiding this comment.
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
py_src/fusion/report.py
Outdated
client: Fusion | None = None, | ||
return_resp_obj: bool = False, | ||
) -> requests.Response | None: | ||
"""Partially update this report using HTTP PATCH. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove http patch
py_src/fusion/report.py
Outdated
payload["regulatoryRelated"] = v | ||
continue | ||
|
||
# flat "publisher_node_identifier" -> nested publisherNode.publisherNodeIdentifier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the commented line
py_tests/test_dataflow.py
Outdated
{ | ||
"providerNode": {"name": "CRM_DB", "nodeType": "Database"}, | ||
"consumerNode": {"name": "DWH", "nodeType": "Database"}, | ||
"providerNode": {"name": "CRM_DB", "type": "Database"}, # was nodeType |
There was a problem hiding this comment.
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
py_src/fusion/dataflow.py
Outdated
providerNode: dict[str, str] | None = None | ||
consumerNode: dict[str, str] | None = None | ||
# --- camelCase field names (kept as-is) --- | ||
providerNode: dict[str, Any] | None = None |
There was a problem hiding this comment.
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
py_src/fusion/dataflow.py
Outdated
Attributes: | ||
providerNode (dict[str, str] | None): | ||
providerNode (dict[str, Any] | None): |
There was a problem hiding this comment.
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]
py_src/fusion/dataflow.py
Outdated
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): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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
py_src/fusion/dataflow.py
Outdated
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. |
There was a problem hiding this comment.
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
py_src/fusion/dataflow.py
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this commented line
py_src/fusion/dataflow.py
Outdated
) | ||
|
||
patch_body = {snake_to_camel(k): v for k, v in normalized.items()} | ||
# normalize empty strings to None recursively, keep keys camelCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate code
py_src/fusion/dataflow.py
Outdated
|
||
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: |
There was a problem hiding this comment.
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()
py_src/fusion/fusion.py
Outdated
- mnpi_indicator (bool) | ||
- country_of_reporting_obligation (str) | ||
- primary_regulator (str) | ||
description (str | None): Description of the report. |
There was a problem hiding this comment.
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
py_src/fusion/fusion.py
Outdated
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, |
There was a problem hiding this comment.
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
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
fa8af4e
to
80cfb3b
Compare
py_src/fusion/dataflow.py
Outdated
) | ||
|
||
patch_body = {snake_to_camel(k): v for k, v in normalized.items()} | ||
def clean(v: Any) -> Any: |
There was a problem hiding this comment.
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()
py_src/fusion/dataflow.py
Outdated
return_resp_obj: bool = False, | ||
) -> requests.Response | None: | ||
"""Partial update (PATCH) using self.id. Provider/consumer nodes are not allowed.""" | ||
"""Partial update using id. |
There was a problem hiding this comment.
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
py_src/fusion/report.py
Outdated
|
||
def convert_keys(d: dict[str, Any]) -> dict[str, Any]: | ||
converted = {} | ||
converted: dict[str, Any] = {} |
There was a problem hiding this comment.
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
py_src/fusion/report.py
Outdated
... ) | ||
>>> payload = report.to_dict() | ||
""" | ||
def _camelize(obj: Any) -> Any: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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
- 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: |
There was a problem hiding this comment.
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()?
py_src/fusion/report.py
Outdated
|
||
def update_fields( | ||
self, | ||
fields_to_update: dict[str, Any], |
There was a problem hiding this comment.
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
py_src/fusion/report.py
Outdated
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use to_dict()
No description provided.