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: Remove model_config for sphinx #474

Merged
merged 2 commits into from
Jun 27, 2024
Merged

Conversation

hiohiohio
Copy link
Contributor

Context:

  • we have added model_config = ConfigDict(protected_namespaces=tuple()) to avoid an error of sphinx
  • NameError: Field "model_fields" conflicts with member {} of protected namespace "model_".
  • found a workaround to avoid putting the member variable

Changes:

  • import a module in conf.py to remove model_config

docs/conf.py Outdated
# import a module here to avoid an error of:
# NameError: Field "model_fields" conflicts with member {} of protected namespace "model_".
# ref. https://github.com/pydantic/pydantic/discussions/7763#discussioncomment-8417097
import alpaca.data.models.screener
Copy link
Contributor

@matebudai matebudai Jun 18, 2024

Choose a reason for hiding this comment

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

Interesting, sadly:
conf.py:21:0: W0611: Unused import alpaca.data.models.screener (unused-import)
But acceptable trade off.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! added noqa flag. 5091d42

Copy link
Contributor

@matebudai matebudai left a comment

Choose a reason for hiding this comment

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

LGTM.

@hiohiohio hiohiohio merged commit 6e3f3a9 into master Jun 27, 2024
12 checks passed
@hiohiohio hiohiohio deleted the remove-model-config-for-sphinx branch June 27, 2024 05:21
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