[pull] main from databricks:main#239
Merged
Merged
Conversation
This PR updates the SDK to the latest API changes. NO_CHANGELOG=true Co-authored-by: databricks-ci-ghec-2[bot] <184307802+databricks-ci-ghec-2[bot]@users.noreply.github.com>
## Summary Two tests hardcode relative paths (`tests/testdata/...` and `databricks/__init__.py`) that only resolve when pytest's cwd is the SDK root. Switch them to `pathlib.Path(__file__)`-based paths so they work no matter where pytest is launched. ## Why Today's upstream invocation (`make test` from the SDK root) is the happy case, so it goes unnoticed. But pytest from any other directory — a different CWD, a CI runner that builds the source tree elsewhere, or a Bazel test sandbox — fails the tests with `FileNotFoundError`. ## What changed ### Interface changes None. ### Behavioral changes None (same fixture files, just resolved by absolute path). ### Internal changes - `tests/test_model_serving_auth.py`: `\"tests/testdata/model-serving-test-token\"` and `\"...-v2\"` parameters replaced with constants computed from `pathlib.Path(__file__).parent / \"testdata\"`. - `tests/test_init_file.py`: `open(\"databricks/__init__.py\")` replaced with `open(pathlib.Path(__file__).parent.parent / \"databricks\" / \"__init__.py\")`. ## How is this tested? - `make test` from the SDK root: 2073 passed, 3 skipped, same baseline as main. - `pytest tests/test_model_serving_auth.py tests/test_init_file.py` from outside the SDK root (e.g. `/tmp`): now passes (previously fails with `FileNotFoundError`). NO_CHANGELOG=true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )