Skip to content

Commit

Permalink
[check builder] 3.12.4 fix (#22986)
Browse files Browse the repository at this point in the history
`recursive_guard` got made keyword arg only in
python/cpython#118009 which released in `3.12.4`
(we run an older version in buildkite so we missed it)

fixes #22985

## How I Tested These Changes

on a fresh 3.12.4 venv
`pytest
python_modules/dagster/dagster_tests/general_tests/test_record.py
python_modules/dagster/dagster_tests/general_tests/check_tests/test_check.py`
which was failing before fix
  • Loading branch information
alangenfeld authored Jul 12, 2024
1 parent 66fdc0f commit b3e0cd4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions python_modules/dagster/dagster/_check/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,16 @@ def eval_forward_ref(self, ref: ForwardRef) -> Optional[Type]:
return type(ref.__forward_arg__, (_LazyImportPlaceholder,), {})
try:
if sys.version_info <= (3, 9):
return ref._evaluate(self.get_merged_ns(), {}) # noqa
return ref._evaluate( # noqa
globalns=self.get_merged_ns(),
localns={},
)
else:
return ref._evaluate(self.get_merged_ns(), {}, frozenset()) # noqa
return ref._evaluate( # noqa
globalns=self.get_merged_ns(),
localns={},
recursive_guard=frozenset(),
)
except NameError as e:
raise CheckError(
f"Unable to resolve {ref}, could not map string name to actual type using captured frames. "
Expand Down

0 comments on commit b3e0cd4

Please sign in to comment.