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

BaseResource.contained is incorrectly typed and doesn't have None as a default #9

Open
kbehlers opened this issue Feb 23, 2024 · 1 comment

Comments

@kbehlers
Copy link

Thank you for the quick response on #7, here is another typing issue.

It seems like the upstream fern/fhir has BaseResource.contained defined correctly as a nullable list of ResourceList

      contained:
        docs: These resources do not have an independent existence apart from the
          resource that contains them - they cannot be identified independently, and
          nor can they have their own independent transaction scope.
        type: optional<list<ResourceList>>

metriport-python seems to have it as Any and no default

    contained: typing.Any = pydantic.Field(
        description="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope."
    )
@kbehlers
Copy link
Author

kbehlers commented Feb 23, 2024

Looks like this may be problematic across any field with ResourceList in the definition.

OperationOutcome.resource and BundleResponse.outcome are others that use ResourceList but end up being typing.Any

Searching with regex has a few off-target hits, but seems to mostly identify the problematic type hints.

(?<!\*\*kwargs: )(?<!str, )(?<!kwargs_with_defaults: )typing\.Any

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

No branches or pull requests

1 participant