Skip to content

Commit

Permalink
chore: ff type adapter typing
Browse files Browse the repository at this point in the history
  • Loading branch information
z3z1ma committed Apr 8, 2024
1 parent e8ac6bb commit 9927ce4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cdf/core/feature_flag/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
NoopFlagProvider,
]

_FlagProvider: pydantic.TypeAdapter[FlagProvider] = pydantic.TypeAdapter(FlagProvider)


def _ensure_dict(o: t.Any) -> t.Dict[str, t.Any]:
"""Unwraps dynaconf config objects to dict."""
Expand All @@ -32,9 +34,7 @@ def load_feature_flag_provider(
) -> FlagProvider:
options = _ensure_dict(options or {})
options["provider"] = provider
return t.cast(
FlagProvider, pydantic.TypeAdapter(FlagProvider).validate_python(options)
)
return _FlagProvider.validate_python(options)


__all__ = [
Expand Down

0 comments on commit 9927ce4

Please sign in to comment.