Skip to content

Commit

Permalink
fix mypy checks due to upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Goodman committed Mar 9, 2020
1 parent 16e7940 commit 69bef89
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/prefect/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
},
Expand All @@ -401,7 +401,7 @@ def query_flow_runs(self, tenant_id: str) -> list:
{
"where": {
"state_start_time": {
"_lte": str(now.subtract(seconds=3))
"_lte": str(now.subtract(seconds=3)) # type: ignore
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/prefect/agent/kubernetes/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def check_heartbeat() -> None:
"""
Check the agent's heartbeat by verifying heartbeat file has been recently modified
"""
current_timestamp = pendulum.now().timestamp()
current_timestamp = pendulum.now().timestamp() # type: ignore
last_modified_timestamp = path.getmtime("{}/heartbeat".format(AGENT_DIRECTORY))

# If file has not been modified in the last 40 seconds then raise an exit code of 1
Expand Down
2 changes: 1 addition & 1 deletion src/prefect/engine/result_handlers/azure_result_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def write(self, result: Any) -> str:
Returns:
- str: the Blob URI
"""
date = pendulum.now("utc").format("Y/M/D")
date = pendulum.now("utc").format("Y/M/D") # type: ignore
uri = "{date}/{uuid}.prefect_result".format(date=date, uuid=uuid.uuid4())
self.logger.debug("Starting to upload result to {}...".format(uri))

Expand Down
2 changes: 1 addition & 1 deletion src/prefect/engine/result_handlers/gcs_result_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def write(self, result: Any) -> str:
Returns:
- str: the GCS URI
"""
date = pendulum.now("utc").format("Y/M/D")
date = pendulum.now("utc").format("Y/M/D") # type: ignore
uri = "{date}/{uuid}.prefect_result".format(date=date, uuid=uuid.uuid4())
self.logger.debug("Starting to upload result to {}...".format(uri))
binary_data = base64.b64encode(cloudpickle.dumps(result)).decode()
Expand Down
2 changes: 1 addition & 1 deletion src/prefect/engine/result_handlers/s3_result_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def write(self, result: Any) -> str:
Returns:
- str: the S3 URI
"""
date = pendulum.now("utc").format("Y/M/D")
date = pendulum.now("utc").format("Y/M/D") # type: ignore
uri = "{date}/{uuid}.prefect_result".format(date=date, uuid=uuid.uuid4())
self.logger.debug("Starting to upload result to {}...".format(uri))

Expand Down
1 change: 1 addition & 0 deletions src/prefect/schedules/clocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def events(self, after: datetime = None) -> Iterable[ClockEvent]:
assert isinstance(after, datetime) # mypy assertion
after = pendulum.instance(after)
assert isinstance(after, pendulum.DateTime) # mypy assertion
assert isinstance(after.tz, pendulum.tz._Timezone) # mypy assertion

# croniter's DST logic interferes with all other datetime libraries except pytz
after_localized = pytz.timezone(after.tz.name).localize(
Expand Down

0 comments on commit 69bef89

Please sign in to comment.