-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Change Click error test assertions to be agnostic to Click version #2135
Conversation
69bef89
to
cc773da
Compare
@@ -381,7 +381,7 @@ def query_flow_runs(self, tenant_id: str) -> list: | |||
"state": {"_eq": "Running"}, | |||
"task_runs": { | |||
"state_start_time": { | |||
"_lte": str(now.subtract(seconds=3)) | |||
"_lte": str(now.subtract(seconds=3)) # type: ignore |
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.
@wagoodman forgot to ask: why were the typing changes necessary? Is this related to the new version of pendulum?
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.
Yes, there were mypy failures:
src/prefect/schedules/clocks.py:260: error: Item "None" of "Optional[Timezone]" has no attribute "name"
src/prefect/client/client.py:435: error: Incompatible types in assignment (expression has type "str", variable has type "DateTime")
src/prefect/client/client.py:482: error: Incompatible types in assignment (expression has type "str", variable has type "DateTime")
src/prefect/engine/result_handlers/s3_result_handler.py:94: error: Call to untyped function "format" in typed context
src/prefect/engine/result_handlers/gcs_result_handler.py:80: error: Call to untyped function "format" in typed context
src/prefect/engine/result_handlers/azure_result_handler.py:102: error: Call to untyped function "format" in typed context
src/prefect/agent/agent.py:384: error: Call to untyped function "subtract" in typed context
src/prefect/agent/agent.py:404: error: Call to untyped function "subtract" in typed context
src/prefect/agent/kubernetes/agent.py:24: error: Call to untyped function "timestamp" in typed context
The latest pendulum changes seem to be causing it (I think it's related to python-pendulum/pendulum#320 but didn't dig deeper):
~/code/prefect click-test-error-output*
venv381 ❯ mypy --config setup.cfg src
src/prefect/agent/kubernetes/agent.py:24: error: Call to untyped function "timestamp" in typed context
Found 1 error in 1 file (checked 179 source files)
~/code/prefect click-test-error-output* 11s
venv381 ❯ pip uninstall pendulum
Found existing installation: pendulum 2.1.0
Uninstalling pendulum-2.1.0:
...
Successfully uninstalled pendulum-2.1.0
~/code/prefect click-test-error-output*
venv381 ❯ pip install pendulum==2.0.5
Collecting pendulum==2.0.5
...
Successfully installed pendulum-2.0.5
~/code/prefect click-test-error-output* 14s
venv381 ❯ mypy --config setup.cfg src
Success: no issues found in 179 source files
Fix click test assertion to account for click v7.1 error formatting change. Also fixes select mypy issues due to mypy rule updates.