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

AIP-84 Fix: Allow Null Values for end_date Field in Dashboard Endpint in FastAPI #44043

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bugraoz93
Copy link
Collaborator

@bugraoz93 bugraoz93 commented Nov 14, 2024

related: #43846

  • Allow safe_date_time to return None if the input is None
  • Handle None in queries/endpoints
  • Simplify unit tests

I have created a separate PR because write permissions don't allow me to push to the existing PR.
cc: @bbovenzi @pierrejeambrun @tirkarthi


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@bugraoz93 bugraoz93 changed the title Allow safe_date_time to return none if input none, handle None in que… AIP-84 Fix: Allow Null Values for Dashboard Endpint in FastAPI Nov 14, 2024
@bugraoz93 bugraoz93 changed the title AIP-84 Fix: Allow Null Values for Dashboard Endpint in FastAPI AIP-84 Fix: Allow Null Values for end_date Field in Dashboard Endpint in FastAPI Nov 14, 2024
# DagRuns
dag_run_types = session.execute(
select(DagRun.run_type, func.count(DagRun.run_id))
.where(
DagRun.start_date >= start_date,
func.coalesce(DagRun.end_date, timezone.utcnow()) <= end_date,
func.coalesce(DagRun.end_date, timezone.utcnow()) <= func.coalesce(end_date, timezone.utcnow()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timezone.utcnow() can be just defined once at the top of the function to avoid different values due to multiple calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants