Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@PythonFZ
Copy link
Member

@PythonFZ PythonFZ commented May 9, 2025

  • do not allow node.outs_path in dc deps_path?
  • update docs

@PythonFZ PythonFZ requested a review from Copilot May 9, 2025 14:43
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 adds support for excluding dataclass fields marked with FieldTypes.PARAMS_PATH and FieldTypes.DEPS_PATH when converting objects for YAML output, and it updates tests to validate the new behavior.

  • Excludes fields with specific metadata when converting dataclass instances to dictionaries.
  • Updates DVC, params, and JSON configuration tests to reflect the new exclusion logic.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
zntrack/plugins/dvc_plugin/init.py Added logic to filter out fields using PARAMS_PATH/DEPS_PATH metadata and updated stage creation logic.
tests/files/zntrack_config/dataclass_w_deps_params_path.json Updated configuration to match the new exclusion behavior.
tests/files/test_dataclass_w_deps_params_path.py Added new tests to verify proper handling of deps_path and params_path in dataclass models.
tests/files/params_config/dataclass_w_deps_params_path.yaml Updated params YAML to reflect the changes in dataclass conversion.
tests/files/dvc_config/dataclass_w_deps_params_path.yaml Updated DVC YAML to support the new dependency path behavior.
Comments suppressed due to low confidence (1)

zntrack/plugins/dvc_plugin/init.py:88

  • [nitpick] The loop variable 'f' could be renamed to 'field_name' for improved clarity.
for f in exclude_fields:

@PythonFZ PythonFZ marked this pull request as ready for review May 9, 2025 14:52
@github-actions
Copy link

github-actions bot commented May 9, 2025

Benchmark

Write: Varying number of nodes

Write: Varying number of edges

@codecov
Copy link

codecov bot commented May 9, 2025

Codecov Report

Attention: Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.01%. Comparing base (ba67ff1) to head (c5202d6).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
zntrack/plugins/dvc_plugin/__init__.py 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #915      +/-   ##
==========================================
+ Coverage   88.87%   89.01%   +0.14%     
==========================================
  Files          36       36              
  Lines        2067     2085      +18     
==========================================
+ Hits         1837     1856      +19     
+ Misses        230      229       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@PythonFZ PythonFZ requested a review from Copilot May 14, 2025 18:04
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 enhances support for dataclass dependencies by adding specialized handling for parameters and dependency paths and updating related documentation and tests.

  • Introduces _dataclass_to_dict to filter out fields with params_path and deps_path.
  • Updates conversion methods to use the new helper, fixes an error message typo, and adjusts tests to validate wrong field usage.
  • Updates documentation with examples supporting params_path and deps_path.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
zntrack/plugins/dvc_plugin/init.py Added _dataclass_to_dict with filtering for field types and fixed typo in error message.
tests/integration/test_deps_dataclass.py Updated tests for handling wrong field initialization and naming of test classes.
tests/files/zntrack_config/dataclass_w_deps_params_path.json Added configuration file for nodes using dataclass deps_path and params_path.
tests/files/test_dataclass_w_deps_params_path.py Added tests for models with parameters and dependency paths in dataclasses.
tests/files/params_config/dataclass_w_deps_params_path.yaml Added params configuration reflecting the new dataclass support.
tests/files/dvc_config/dataclass_w_deps_params_path.yaml Added DVC stages configuration that integrates new deps_path and params_path behavior.
docs/source/node_details.rst Updated documentation to include examples for params_path and deps_path usage.
Comments suppressed due to low confidence (1)

zntrack/plugins/dvc_plugin/init.py:37

  • Avoid using 'object' as a parameter name since it shadows the built-in type; consider renaming it to 'obj'.
def _dataclass_to_dict(object) -> dict:

@PythonFZ PythonFZ merged commit 23cb098 into main May 15, 2025
10 checks passed
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