Skip to content

Conversation

@aversey
Copy link
Contributor

@aversey aversey commented Nov 24, 2025

This PR adds/fixes/changes...

  • please summarize your changes to the code
  • and make sure to include all changes to user-facing APIs

JIRA Issue: -

Priority for Review: -

Related PRs: -

How Has This Been Tested?

  • Unit Tests
  • Integration Tests
  • Manual Tests on VM

Checklist For The Assigned Reviewer:

- [ ] Checked if merge conflicts with master exist
- [ ] Checked if stylechecks for Java and Python pass
- [ ] Checked if all docstrings were added and/or updated appropriately
- [ ] Ran spellcheck on docstring
- [ ] Checked if guides & concepts need to be updated
- [ ] Checked if naming conventions for parameters and variables were followed
- [ ] Checked if private methods are properly declared and used
- [ ] Checked if hard-to-understand areas of code are commented
- [ ] Checked if tests are effective
- [ ] Built and deployed changes on dev VM and tested manually
- [x] (Checked if all type annotations were added and/or updated appropriately)

@aversey aversey requested review from Copilot, robzor92 and vatj December 5, 2025 16:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes Python type hints across the codebase by replacing typing.Optional and typing.Union with their PEP 604 equivalents (X | None and X | Y), updates import patterns to use TYPE_CHECKING guards for circular dependencies, and improves documentation formatting by converting to Google-style docstrings with proper markdown formatting.

Key Changes:

  • Replaced Optional[X] with X | None and Union[X, Y] with X | Y throughout the codebase
  • Moved type-only imports under TYPE_CHECKING guards to avoid circular import issues
  • Converted docstrings from custom format to Google-style with proper markdown
  • Removed unnecessary else clauses after return statements
  • Updated string formatting to use f-strings

Reviewed changes

Copilot reviewed 247 out of 364 changed files in this pull request and generated no comments.

Show a summary per file
File Description
python/hsfs/core/feature_descriptive_statistics.py Updated type hints and moved imports under TYPE_CHECKING guard
python/hsfs/core/external_feature_group_engine.py Fixed string concatenation in error messages
python/hsfs/core/explicit_provenance.py Modernized type hints, simplified conditionals, and improved docstrings
python/hsfs/core/expectation_suite_engine.py Updated type hints and moved imports under TYPE_CHECKING
python/hsfs/core/expectation_suite_api.py Removed unnecessary typing imports and updated type hints
python/hsfs/core/expectation_engine.py Added TYPE_CHECKING guard and simplified conditionals
python/hsfs/core/expectation_api.py Updated docstrings and fixed punctuation
python/hsfs/core/delta_engine.py Modernized type hints and removed unnecessary else clauses
python/hsfs/core/data_source_data.py Updated type hints and simplified docstrings
python/hsfs/core/data_source.py Simplified conditionals and updated type hints
python/hsfs/core/arrow_flight_client.py Added TYPE_CHECKING guard and simplified boolean logic
python/hsfs/constructor/serving_prepared_statement.py Updated type hints across all methods
python/hsfs/constructor/query.py Comprehensive type hint updates and docstring improvements
python/hsfs/constructor/prepared_statement_parameter.py Updated type hints for all properties
python/hsfs/constructor/join.py Simplified type hints
python/hsfs/constructor/hudi_feature_group_alias.py Updated type hints
python/hsfs/constructor/fs_query.py Updated type hints throughout
python/hsfs/constructor/filter.py Modernized type hints and simplified error messages
python/hsfs/constructor/external_feature_group_alias.py Updated type hints
python/hsfs/builtin_transformations.py Removed unnecessary list comprehensions
python/hsfs/init.py Updated to f-string formatting
python/hopsworks_common/util.py Comprehensive type hint updates and docstring improvements
python/hopsworks_common/user.py Updated type hints in dataclass
python/hopsworks_common/usage.py Simplified conditional logic
python/hopsworks_common/triggered_alert.py Improved property docstrings
python/hopsworks_common/secret.py Updated docstring formatting
python/hopsworks_common/search_results.py Modernized type hints across search result classes
python/hopsworks_common/project.py Updated method return types and improved docstrings
python/hopsworks_common/kafka_topic.py Updated type hints and docstrings
python/hopsworks_common/kafka_schema.py Improved docstring formatting
python/hopsworks_common/job_schedule.py Fixed docstring formatting
python/hopsworks_common/job.py Added Literal types for state/status and improved docstrings
python/hopsworks_common/git_*.py Updated type hints and docstrings across all git-related modules
python/hopsworks_common/flink_cluster.py Added Literal types and improved docstrings
python/hopsworks_common/execution.py Updated type hints and docstrings
python/hopsworks_common/environment.py Added TYPE_CHECKING guard and updated docstrings
python/hopsworks_common/engine/*.py Updated type hints and docstrings
python/hopsworks_common/decorators.py Removed unnecessary else clause
python/hopsworks_common/core/*.py Comprehensive type hint and docstring updates
docs/transformation_statistics.md Added new documentation file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aversey
Copy link
Contributor Author

aversey commented Dec 5, 2025

See logicalclocks/logicalclocks.github.io#532 for the related PR.

@aversey aversey enabled auto-merge (squash) December 5, 2025 17:29
Copy link
Contributor

@vatj vatj left a comment

Choose a reason for hiding this comment

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

Nice and thorough work, I think I somewhat understand the ideas underlying the PR so I am happy with merging

@aversey aversey requested a review from robzor92 December 8, 2025 12:01
@aversey aversey disabled auto-merge December 8, 2025 12:03
@aversey
Copy link
Contributor Author

aversey commented Dec 8, 2025

The branch passed:

./workflows/hopsworks/test_secrets.py
./workflows/hopsworks/test_python_job_execution.py
./workflows/hopsworks/test_opensearch.py
./workflows/hopsworks/test_environment.py
./workflows/hopsworks/test_git.py
./workflows/feature_store/python_driver/test_get_feature_vectors.py::test_feature_vector_transformations
./workflows/feature_store/pyspark_driver/test_get_feature_vectors.py::test_feature_vector_transformations
./workflows/feature_store/python_driver/test_get_feature_vectors.py::test_manual_all_return_types
./workflows/feature_store/pyspark_driver/test_get_feature_vectors.py::test_manual_all_return_types
./workflows/feature_store/python_driver/test_batch.py
./workflows/feature_store/pyspark_driver/test_batch.py
./workflows/feature_store/python_driver/test_feature_group_insert.py
./workflows/feature_store/pyspark_driver/test_feature_group_insert.py::test_pyspark_feature_group_insert

But failed (it passed the other one, not HUDI):

workflows/feature_store/python_driver/test_feature_group_transformation_functions.py::test_many_to_many_on_demand_transformation_with_model_dependent_transformations[HUDI]

With:

WARNING  hopsworks_common.client.online_store_rest_client:vector_server.py:337 Online Store Rest Client is already initialised. To reset connection or/and override configuration, use reset_online_store_rest_client flag.
ERROR    hsfs.core.online_store_rest_client_api:online_store_rest_client_api.py:190 Received response from RonDB Rest Server with status code 401
ERROR    hsfs.core.online_store_rest_client_api:online_store_rest_client_api.py:193 Response: API key not authorized to access fg_tf_kiutf

I guess it is not an error introduced in this PR.

@aversey
Copy link
Contributor Author

aversey commented Dec 9, 2025

workflows/feature_store/python_driver/test_feature_pipeline.py::test_feature_pipeline[True-DELTA]

Is also failing (another one in test_feature_pipeline is ok). These passed:

./workflows/feature_store/python_driver/test_feature_logging.py::test_logging_one_row_entire_dataframe_and_some_seperate
./workflows/feature_store/pyspark_driver/test_feature_logging.py::test_logging_one_row_entire_dataframe_and_some_seperate
./workflows/feature_store/python_driver/test_feature_logging.py::test_implicit_logging_batch_data
./workflows/feature_store/pyspark_driver/test_feature_logging.py::test_implicit_logging_batch_data

@aversey
Copy link
Contributor Author

aversey commented Dec 9, 2025

./workflows/feature_store/python_driver/test_training_data.py
./workflows/feature_store/pyspark_driver/test_training_data.py
./workflows/feature_store/pyspark_driver/test_statistics.py
./workflows/feature_store/python_driver/test_statistics.py
./workflows/feature_store/python_driver/test_similarity_search.py::test_all_data_types

Have also passed.

@aversey
Copy link
Contributor Author

aversey commented Dec 9, 2025

It also passed:

./workflows/model_serving/python_driver/external/test_deploy_model_and_predict.py::test_deploy_and_predict_python_model_with_logging_with_kserve
./workflows/model_serving/python_driver/external/test_deploy_model_and_predict.py::test_deploy_and_call_endpoint_with_kserve_with_feature_logging
./workflows/model_serving/python_driver/internal/test_deploy_model_and_predict.py::test_deploy_and_test_endpoint_with_kserve_with_feature_logging
./workflows/model_serving/python_driver/internal/test_deploy_model_and_predict.py::test_deploy_and_predict_python_model_with_kserve_with_feature_logging

@aversey aversey merged commit d53eeed into logicalclocks:main Dec 12, 2025
17 checks passed
jimdowling pushed a commit to jimdowling/hopsworks-api that referenced this pull request Dec 13, 2025
* A fix for multirepo plugin

* Move docs

* Attempt to use mkdocstrings

* A fix of path in alerts

* Should work now even with the aliases

* Fix it back

* Fix docstrings in alerts_api.py

* Fixes for AlertsApi

* Fix Project.get_alerts_api docstring and type hint

* More fixes for the AlertsApi docs

* Adapt projects.md

* Fix AlertsApi docs

* Add titles

* Attempt to use nv import

* Fix

* Fix of paths

* Fix javadoc link

* Fix docstrings of alerts and project

* Show full path for Project

* Update action

* Add multirepo dependency

* Prepare for multirepo builds

* Add markdownlint

* Fix typing error

* Add markdownlint config and fixes

* More fixes

* Update markdownlint action

* A bit of markdown fixes

* Fix login API

* Fix UDF

* Fix the trigger-rebuild payload

* Fix UDF import

* Fix login docstrings

* An attempt to fix login docstring

* A bit more fixes of login docstrings

* A bit more of fixes of the docs

* Finish the platform API docs

* Transform API reference into the new format

* Add missing pages

* Fix mistype

* Show inherited members of FeatureGroup

* Start converting docstrings to Google style

* An update of CONTRIBUTING,md

* Update docstrings up to feature_group

* Fix lists in feature_group

* Convert up to storage_connector

With a TODO in feature_view.

* A bit more work in storage_connector

* Fix Attributes

* A bit more conversions

* Fixes

* Fix links

* Flatten the docs structure for easier linking

* Update deps

* Fix deps

* Fix mkdocs.yaml

* Add inventories

* Remove a todo

* Fix links in links

* Convert example-headers

* Fix links

* Add more docs

* Fix paths

* Fix labels

* Copy CONTRIBUTING.md

* Update CONTRIBUTING.md

* Ruff

* Ruff

* Ruff

* Ruff

* Update CONTRIBUTING.md

* Ruff

* Ruff

* Ruff

* Ruff

* Ruff

* Ruff

* Ruff

* Ruff TC

* Ruff future annotations

* Ruff

* MDlint

* Update ruff

* Update ruff in actions

* More fixes

* Fix

* Fix imports

* Fix

* Fix typo

* Handle CONTRIBUTING doc page via a symlink

* Turn symlink the other way around

* Update CONTRIBUTING.md

* Update

* The last fix of headers

* Fix links

* Fix links

* Fix more links

* More link fixes

* Fix aliases in hsml

* Fix some exception docstrings

* Add OpensearchRequestOption docs

* More fixes

* A fix

* Sync mkdocs.yml

* Fix code blocks

* Final change

* Remove redundant copying

* Fix mkdocs.yml

* Fix

* Pin versions

* Triggger deployment of dev docs

* Update contributing guidelines on patch notes

* Mention the development version
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.

3 participants