refactor: adjust get_version and get_version_history method name#491
refactor: adjust get_version and get_version_history method name#491thiagobomfin-galileo wants to merge 2 commits intomainfrom
Conversation
ae4dc14 to
dc157e9
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #491 +/- ##
=======================================
Coverage 82.03% 82.03%
=======================================
Files 96 96
Lines 9274 9274
=======================================
Hits 7608 7608
Misses 1666 1666 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fernandocorreia-galileo
left a comment
There was a problem hiding this comment.
@thiagobomfin-galileo it's looking like this was reported by mistake. I asked for a clarification, let's put this on hold for now.
| def get_version(self, version_index: int) -> DatasetContent: | ||
| return get_dataset_version_content_datasets_dataset_id_versions_version_index_content_get.sync( | ||
| dataset_id=self.dataset.id, version_index=version_index, client=self.config.api_client | ||
| ) |
There was a problem hiding this comment.
Dataset.load_version was removed/renamed to Dataset.get_version without providing a compatibility shim, so any external client still calling load_version now gets AttributeError and the public SDK API is broken; can we keep load_version (e.g. alias it to get_version or leave both names) or document/deprecate before removal?
Finding type: Breaking Changes
Want Baz to fix this for you? Activate Fixer
Other fix methods
Prompt for AI Agents:
In src/galileo/datasets.py around lines 156-159, the Dataset.load_version method was
removed/renamed to get_version which breaks external clients. Restore backward
compatibility by adding a load_version method that delegates to get_version (for
example: def load_version(self, version_index: int) -> DatasetContent: return
self.get_version(version_index)) and include a DeprecationWarning in the method
docstring or via warnings.warn to signal the rename. This will keep the public SDK API
stable while allowing consumers to migrate.
User description
Shortcut:
NewSDK: Rename get_version to load_version for clarity
Description:
Adjust get_version and get_version_history methods names to load_version and load_version_history for more clarity
Unit tests already cover tests cases
Tests:
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Clarify dataset version handling by renaming
get_version/get_version_historytoload_version/load_version_historyso the APIs emphasize that they mutate the current dataset object. Update the Dataset service helpers and related unit tests to call the renamed methods while preserving previous functionality.Latest Contributors(2)