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 EnvBaseMixins issues when subclassing with other generics #14

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

rpmcginty
Copy link
Collaborator

@rpmcginty rpmcginty commented Oct 30, 2024

Details

fixes an issue in aibs-informatics-aws-lambda

env_base = None, env_base_class = <class 'aibs_informatics_aws_lambda.handlers.demand.model.PrepareDemandScaffoldingRequest'>

    def get_env_base(
        env_base: Optional[Union[str, E]] = None,
        env_base_class: Optional[Type[Union[E, EnvBase]]] = None,
    ) -> Union[E, EnvBase]:
        """Will look for the env_base as an environment variable."""
        env_base_cls: Type[E] = env_base_class or EnvBase  # type: ignore[assignment]
        if env_base:
            if isinstance(env_base, env_base_cls):
                return env_base
            else:
                return env_base_cls(env_base)
>       return env_base_cls.from_env()
E       AttributeError: type object 'PrepareDemandScaffoldingRequest' has no attribute 'from_env'

@rpmcginty
Copy link
Collaborator Author

verified make release passes

@rpmcginty rpmcginty merged commit ffd5ba9 into main Oct 30, 2024
4 checks passed
@rpmcginty rpmcginty deleted the bugfix/env-base-mixins-issue branch October 30, 2024 06:25
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.

1 participant