Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,5 @@ jobs:
- name: publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
TWINE_PASSWORD: ${{ secrets.PYPI_API_FUSIONDEVS }}
run: uv run twine upload dist/*
2 changes: 1 addition & 1 deletion py_src/fusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """Fusion Devs"""
__email__ = "[email protected]"
__version__ = "3.0.1"
__version__ = "3.0.2-dev0"

from fusion.credentials import FusionCredentials
from fusion.fs_sync import fsync
Expand Down
9 changes: 5 additions & 4 deletions py_src/fusion/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
CamelCaseMeta,
camel_to_snake,
convert_date_format,
ensure_resources,
handle_paginated_request,
make_bool,
requests_raise_for_status,
snake_to_camel,
Expand Down Expand Up @@ -796,11 +798,10 @@ def from_catalog(self, dataset: str, catalog: str | None = None, client: Fusion
client = self._use_client(client)
catalog = client._use_catalog(catalog)
url = f"{client.root_url}catalogs/{catalog}/datasets/{dataset}/attributes"
response = client.session.get(url)
requests_raise_for_status(response)
list_attributes = response.json()["resources"]
response = handle_paginated_request(client.session, url)
ensure_resources(response)
list_attributes = response["resources"]
list_attributes = sorted(list_attributes, key=lambda x: x["index"])

self.attributes = [Attribute._from_dict(attr_data) for attr_data in list_attributes]
return self

Expand Down
9 changes: 6 additions & 3 deletions py_src/fusion/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@

from fusion.exceptions import CredentialError

from . import __version__

_DEFAULT_GRANT_TYPE = "client_credentials"
_DEFAULT_AUTH_URL = "https://authe.jpmorgan.com/as/token.oauth2"
VERSION = __version__


def _now_ts() -> int:
Expand Down Expand Up @@ -400,7 +403,7 @@ def refresh_bearer_token(self) -> None:
else:
raise ValueError("Unrecognized grant type")

resp = sess.post(auth_url, data=payload, headers={"User-Agent": "fusion-python-sdk"})
resp = sess.post(auth_url, data=payload, headers={"User-Agent": f"fusion-python-sdk {VERSION}"})
try:
resp.raise_for_status()
except requests.HTTPError as e: # noqa: TRY003
Expand Down Expand Up @@ -437,7 +440,7 @@ def get_fusion_token_headers(self, url: str) -> dict[str, str]: # noqa: PLR0912
if not self.bearer_token:
raise ValueError("No bearer token set (Error Code: 400)")

headers: dict[str, str] = {"User-Agent": "fusion-python-sdk"}
headers: dict[str, str] = {"User-Agent": f"fusion-python-sdk {VERSION}"}
if self.fusion_e2e:
headers["fusion-e2e"] = self.fusion_e2e

Expand Down Expand Up @@ -468,7 +471,7 @@ def get_fusion_token_headers(self, url: str) -> dict[str, str]: # noqa: PLR0912
fusion_auth_url,
headers={
"Authorization": f"Bearer {self.bearer_token.token}",
"User-Agent": "fusion-python-sdk",
"User-Agent": f"fusion-python-sdk {VERSION}",
},
)
try:
Expand Down
Loading