Skip to content

Commit

Permalink
pendulum consolidation in prefect.client
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Feb 11, 2025
1 parent 955378c commit 784096e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/prefect/client/orchestration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import certifi
import httpcore
import httpx
import pendulum

import pydantic
from asgi_lifespan import LifespanManager
from packaging import version
Expand Down Expand Up @@ -130,6 +130,7 @@
PREFECT_SERVER_ALLOW_EPHEMERAL_MODE,
PREFECT_TESTING_UNIT_TEST_MODE,
)
from prefect.types._datetime import DateTime

if TYPE_CHECKING:
from prefect.tasks import Task as TaskObject
Expand Down Expand Up @@ -607,7 +608,7 @@ async def get_runs_in_work_queue(
List[FlowRun]: a list of FlowRun objects read from the queue
"""
if scheduled_before is None:
scheduled_before = pendulum.now("UTC")
scheduled_before = DateTime.now("UTC")

try:
response = await self._client.post(
Expand Down
4 changes: 2 additions & 2 deletions src/prefect/client/schemas/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def is_valid_timezone(v: str) -> bool:
Validate that the provided timezone is a valid IANA timezone.
Unfortunately this list is slightly different from the list of valid
timezones in pendulum that we use for cron and interval timezone validation.
timezones we use for cron and interval timezone validation.
"""
from prefect._internal.pytz import HAS_PYTZ

Expand Down Expand Up @@ -309,7 +309,7 @@ def valid_timezone(cls, v: Optional[str]) -> str:
Validate that the provided timezone is a valid IANA timezone.
Unfortunately this list is slightly different from the list of valid
timezones in pendulum that we use for cron and interval timezone validation.
timezones we use for cron and interval timezone validation.
"""
if v is None:
return "UTC"
Expand Down

0 comments on commit 784096e

Please sign in to comment.