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

Fix SQL schema imports #2098

Merged
merged 1 commit into from
Nov 30, 2023
Merged

Fix SQL schema imports #2098

merged 1 commit into from
Nov 30, 2023

Conversation

stefannica
Copy link
Contributor

@stefannica stefannica commented Nov 30, 2023

Describe changes

I don't know exactly how, but I ran into a dependency error while running a custom-made script that used the zenml SQL store interface directly:

InvalidRequestError: When initializing mapper mapped class ArtifactVersionSchema->artifact_version, expression 'ArtifactVisualizationSchema' failed to locate a name ('ArtifactVisualizationSchema'). If this is a 
class name, consider adding this relationship() to the <class 'zenml.zen_stores.schemas.artifact_schemas.ArtifactVersionSchema'> class after both dependent classes have been defined.

This was apparently fixed by adding the ArtifactVisualizationSchema import to the schemas root module and removing all direct imports from the root module inside the schema sub-modules themselves to avoid circular imports.

Pre-requisites

Please ensure you have done the following:

  • I have read the CONTRIBUTING.md document.
  • If my change requires a change to docs, I have updated the documentation accordingly.
  • If I have added an integration, I have updated the integrations table and the corresponding website section.
  • I have added tests to cover my changes.
  • I have based my new branch on develop and the open PR is targeting develop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (add details above)

@strickvl strickvl added bug Something isn't working internal To filter out internal PRs and issues labels Nov 30, 2023
Copy link
Contributor

@fa9r fa9r left a comment

Choose a reason for hiding this comment

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

It's best practice anyways to specify full import paths, so LGTM and thanks for fixing!

@stefannica stefannica merged commit ed10a66 into develop Nov 30, 2023
34 checks passed
@stefannica stefannica deleted the bug/fix-schema-imports branch November 30, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal To filter out internal PRs and issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants