Skip to content
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

pendulum consolidation in prefect.client #17099

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 now

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 = 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