Skip to content

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

Open
domino-blake wants to merge 12 commits into
masterfrom
blake/pr-features
Open

new API additions — branch param, app_id, files_download, bug fixes#266
domino-blake wants to merge 12 commits into
masterfrom
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, plus one bug fix to _validate_hardware_tier_id. The only existing behaviour change is intentional: _validate_hardware_tier_id now accepts dict input from compute_cluster_properties instead of raising HardwareTierNotFoundException for a valid tier (#174).

A small number of app_publish / app_unpublish deprecation shims (commitId/appId) also land here because they're coupled to the new branch parameter see inline reply for context. Broader rename work lives in PR #267.

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
@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 Outdated
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

Copy link
Copy Markdown
Contributor Author

@domino-blake domino-blake May 12, 2026

Choose a reason for hiding this comment

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

Fixed in eadc0a6. The conditional is restored — get_hardware_tier_id_from_name only runs when hardware_tier_name is non-None. Combined with reverting the parameter type to str 4140ce3, the call site and signature are now consistent.

Comment thread domino/domino.py Outdated
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted to hardware_tier_name: str. With the call-site conditional restored in the previous commit, this function is never reached with None, so the original signature is correct.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Some shim work did land here alongside the new features rather than living cleanly in PR #267:

  • app_publish / app_unpublish shims (commitId → commit_id, appId → app_id): these are coupled to PR B's new branch parameter on app_publish. Adding branch while leaving the adjacent params in camelCase would have shipped a mixed-casing API, so the renames came with the feature.
  • runs_start, run_stop, runs_status, get_run_log, runs_stdout, files_list, endpoint_publish shims: you're right that these are unrelated to PR B's scope and leaked in via a "cherry pick" commit that bundled too much. They're also present on PR rename camelCase params to snake_case with deprecation shims #267 (which is the rename PR), so they'll be deduplicated cleanly when PR rename camelCase params to snake_case with deprecation shims #267 merges after this one.

If you'd prefer, I can either:

  1. Strip the unrelated shims from this PR (would require rewriting history on commit 04e72a7 and the downstream commits that depend on it), or
  2. Add shim coverage to this PR's test file for the ones that touch PR B's APIs (app_publish / app_unpublish), and let PR rename camelCase params to snake_case with deprecation shims #267 cover the rest.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added _app_id as a deprecated alias property that issues a DeprecationWarning and forwards to app_id. Existing callers will keep working for at least one release. 016ab96

Comment thread domino/domino.py Outdated
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"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now raises a ValueError: dff1872

Comment thread domino/domino.py Outdated
: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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added. commits_list() now gets stored, checked for empty, and a ValueError is raised b4b90d9

@domino-blake domino-blake changed the base branch from blake/pr-quality to master May 12, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants