Skip to content

new API additions — branch param, app_id, files_download, bug fixes#266

Open
domino-blake wants to merge 7 commits intoblake/pr-qualityfrom
blake/pr-features
Open

new API additions — branch param, app_id, files_download, bug fixes#266
domino-blake wants to merge 7 commits intoblake/pr-qualityfrom
blake/pr-features

Conversation

@domino-blake
Copy link
Copy Markdown
Contributor

@domino-blake domino-blake commented Apr 22, 2026

What does this PR do?

Adds new backwards-compatible methods and parameters. No existing behaviour changes.

New features

Bug fix

  • _validate_hardware_tier_id now handles dict input (e.g. {"value": "small-k8s"})
    from compute_cluster_properties, which previously caused HardwareTierNotFoundException
    even when the tier existed. Closes BUG: in _validate_hardware_tier_id #174.

Docs

Issues closed

#24, #31, #122, #127, #128, #174, #231

Testing

  • New tests added for every change:

    • tests/test_jobs.py — branch param, hardware tier dict input
    • tests/test_app.pyapp_get_status
    • tests/test_apps.pyapp_id property
    • tests/test_files.pyfiles_download
  • Unit tests passing

  • All changes are backwards compatible

  • Documentation updated

@domino-blake domino-blake changed the title feat: new API additions — branch param, app_id, files_download, bug fixes new API additions — branch param, app_id, files_download, bug fixes Apr 22, 2026
@domino-blake
Copy link
Copy Markdown
Contributor Author

Once #265 merges, need to change this to target master

@ddl-bira-ignacio
Copy link
Copy Markdown
Contributor

The description says "No existing behaviour changes" but there seems to be a few functional changes

Copy link
Copy Markdown
Contributor

@ddl-bira-ignacio ddl-bira-ignacio left a comment

Choose a reason for hiding this comment

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

The description says "No existing behaviour changes", but the diff also includes param renames and deprecation shims.

Comment thread domino/domino.py
self.get_hardware_tier_id_from_name(hardware_tier_name)
if hardware_tier_name
else None
resolved_hardware_tier_id = (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue: Looks like this now calls get_hardware_tier_id_from_name even when no tier name was passed. I think we need to keep this conditional

Comment thread domino/domino.py
return self._get(url)

def get_hardware_tier_id_from_name(self, hardware_tier_name: str):
def get_hardware_tier_id_from_name(self, hardware_tier_name: Optional[str]):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: given hardware_tier_name is used here, I don't think it should be made optional.

Comment thread domino/domino.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue: I see deprecation shims going in across a bunch of methods here, but the tests in this PR are focused on the new features. Would be great to either add shim-specific tests here or split that work into its own PR so coverage stays tight.

Comment thread domino/domino.py
# This will fetch app_id of app in current project
@property
def _app_id(self):
def app_id(self) -> Optional[str]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue: _app_id has been around for a while and some folks might be using it even though it's private. Would it make sense to keep _app_id as a deprecated alias that points to app_id, at least for one release?

Comment thread domino/domino.py
def _validate_hardware_tier_id(self, hardware_tier_id: str) -> bool:
def _validate_hardware_tier_id(self, hardware_tier_id: Union[str, Dict]) -> bool:
if isinstance(hardware_tier_id, dict):
hardware_tier_id = hardware_tier_id.get("value", hardware_tier_id)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: If the dict doesn't have a "value" key, .get just returns the original dict and the tier comparison will never match. Should we raise a clear error here instead of letting it fall through to "not found"?

Comment thread domino/domino.py
:return: Raw file content (urllib3 response stream).
"""
if commit_id is None:
commit_id = self.commits_list()[0]["id"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: Add a guard to commits_list in case it returns empty

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.

2 participants