-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[24.0] Fix TypeError
from Pydantic 2.9.0
#18788
Merged
nsoranzo
merged 1 commit into
galaxyproject:release_24.0
from
nsoranzo:release_24.0_TypeError_discriminator
Sep 7, 2024
Merged
[24.0] Fix TypeError
from Pydantic 2.9.0
#18788
nsoranzo
merged 1 commit into
galaxyproject:release_24.0
from
nsoranzo:release_24.0_TypeError_discriminator
Sep 7, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduced in commit 5133abd . Fix the following traceback: ``` Traceback (most recent call last): File "scripts/dump_openapi_schema.py", line 50, in <module> write_open_api_schema() File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/click/core.py", line 1157, in __call__ return self.main(*args, **kwargs) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) File "scripts/dump_openapi_schema.py", line 37, in write_open_api_schema openapi_schema = get_openapi_schema() File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/webapps/galaxy/fast_app.py", line 166, in get_openapi_schema include_all_package_routers(app, "galaxy.webapps.galaxy.api") File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/webapps/base/api.py", line 250, in include_all_package_routers for _, module in walk_controller_modules(package_name): File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/web/framework/base.py", line 617, in walk_controller_modules module = import_module(module_name) File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 843, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/webapps/galaxy/api/workflows.py", line 79, in <module> from galaxy.schema.workflows import ( File "/home/runner/work/galaxy/galaxy/galaxy root/lib/galaxy/schema/workflows.py", line 179, in <module> class StoredWorkflowDetailed(StoredWorkflowSummary): File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py", line 223, in __new__ complete_model_class( File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_model_construction.py", line 568, in complete_model_class schema = cls.__get_pydantic_core_schema__(cls, handler) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/main.py", line 670, in __get_pydantic_core_schema__ return handler(source) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__ schema = self._handler(source_type) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema schema = self._generate_schema_inner(obj) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 924, in _generate_schema_inner return self._model_schema(obj) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 739, in _model_schema {k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()}, File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 739, in <dictcomp> {k: self._generate_md_field_schema(k, v, decorators) for k, v in fields.items()}, File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 1115, in _generate_md_field_schema common_field = self._common_field_schema(name, field_info, decorators) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 1304, in _common_field_schema schema = self._apply_annotations( File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 2104, in _apply_annotations schema = get_inner_schema(source_type) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__ schema = self._handler(source_type) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 2093, in inner_handler return transform_inner_schema(schema) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 1294, in set_discriminator schema = self._apply_discriminator_to_union(schema, field_info.discriminator) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_generate_schema.py", line 574, in _apply_discriminator_to_union return _discriminated_union.apply_discriminator( File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_discriminated_union.py", line 97, in apply_discriminator return _ApplyInferredDiscriminator(discriminator, definitions or {}).apply(schema) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_discriminated_union.py", line 191, in apply schema = self._apply_to_root(schema) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_discriminated_union.py", line 227, in _apply_to_root self._handle_choice(choice) File "/home/runner/work/galaxy/galaxy/galaxy root/.venv/lib/python3.8/site-packages/pydantic/_internal/_discriminated_union.py", line 289, in _handle_choice raise TypeError( TypeError: 'dict' is not a valid discriminated union variant; should be a `BaseModel` or `dataclass` ```
mvdbeek
approved these changes
Sep 7, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduced in commit 5133abd .
Fix the following traceback:
How to test the changes?
(Select all options that apply)
License