Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add data config checker for property value types #2328

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

joaoandre-avaiga
Copy link
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Related Tickets & Documents

How to reproduce the issue

Please replace this line with instructions on how to reproduce the issue or test the feature.

Other branches or releases that this needs to be backported

Describe which projects this change will impact and that needs to be backported.

Checklist

We encourage you to keep the code coverage percentage at 80% and above.

  • Does this solution meet the acceptance criteria of the related issue?
  • Is the related issue checklist completed?
  • Does this PR adds unit tests for the developed code? If not, why?
  • End-to-End tests have been added or updated?
  • Was the documentation updated, or a dedicated issue for documentation created? (If applicable)
  • Is the release notes updated? (If applicable)

Copy link
Member

@jrobinAV jrobinAV left a comment

Choose a reason for hiding this comment

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

Minor remark.

Otherwise it s greatly neat!

if property_types := data_node_config._PROPERTIES_TYPES.get(data_node_config.storage_type):
for prop_key, prop_type in property_types.items():
prop_value = data_node_config.properties.get(prop_key) if data_node_config.properties else None
if prop_value and not isinstance(prop_value, prop_type):
Copy link
Member

Choose a reason for hiding this comment

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

prop_type is the value in the _PROPERTIES_TYPES dictionary. Today, it must be a Python type.

Can we imagine prop_type being either a type or a list of types? Then, we should check that the type of prop_value is among the types in the prop_type list of types.

Does it make sense, or is it just over-engineering?

@jrobinAV jrobinAV added Core Related to Taipy Core 🟨 Priority: Medium Not blocking but should be addressed Core: ⚙️ Configuration labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core: ⚙️ Configuration Core Related to Taipy Core 🟨 Priority: Medium Not blocking but should be addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add checker to check value type of configuration properties
3 participants