Skip to content

Remove date type for time-based query parameters. #542

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

Merged
merged 2 commits into from
Jun 12, 2025
Merged

Conversation

Schalk1e
Copy link
Collaborator

@Schalk1e Schalk1e commented Jun 10, 2025

Reviewer: @sidravi1
Estimate:


Ticket

Fixes: Datetime casting bug

Description

Querying time filterable endpoints such as queries and urgency-queries with intra-day date-time parameters result in query results for the full day being returned. This is as a result of behaviour described here.

When passing datetime objects, the instance check will always pass since datetime is a date subclass. This will then set the date parameters to the start and end of the days respectively.

Local tests are complaining about duplicated CLI args in core_backend/validation/urgency_detection/conftest.py. I get this even when running pytest -vv in main, so I'm not sure what I'm missing there. I also attempted a mkdocs build to account for the updated docstrings but I don't notice any changes as a result.

Goal

To allow intraday datetimes.

Changes

These changes involve removing date support and relying solely on datetime arguments for these endpoints. This is standard practice.

Future Tasks (optional)

How has this been tested?

The tests have been run and confirmed to pass.

To-do before merge (optional)

Checklist

Fill with x for completed.

  • My code follows the style guidelines of this project
  • I have reviewed my own code to ensure good quality
  • I have tested the functionality of my code to ensure it works as intended
  • I have resolved merge conflicts

(Delete any items below that are not relevant)

  • I have updated the automated tests

@Schalk1e
Copy link
Collaborator Author

Have shown the new tests to fail in main

Copy link
Contributor

@lickem22 lickem22 left a comment

Choose a reason for hiding this comment

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

Thanks @Schalk1e. Approved

@Schalk1e Schalk1e merged commit ed4618a into main Jun 12, 2025
3 checks passed
@Schalk1e Schalk1e deleted the remove_date_type branch June 12, 2025 12:38
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