Skip to content

CHORE: Added tests for subtraction of DateTime fields (#368)#472

Merged
bewithgaurav merged 6 commits into
microsoft:devfrom
PawelKawula:issue-368
Apr 22, 2026
Merged

CHORE: Added tests for subtraction of DateTime fields (#368)#472
bewithgaurav merged 6 commits into
microsoft:devfrom
PawelKawula:issue-368

Conversation

@PawelKawula
Copy link
Copy Markdown
Contributor

@PawelKawula PawelKawula commented Aug 16, 2025

This pull request fixes issue #368
More details about the fix can be found in django ticket here
https://code.djangoproject.com/ticket/31133

@bewithgaurav
Copy link
Copy Markdown
Collaborator

bewithgaurav commented Aug 18, 2025

@PawelKawula - thanks for raising this fix!
We'll take a look at it and review this. I'll run the azure test pipelines for the PR in the meantime, cheers! ✌️

@microsoft microsoft deleted a comment from azure-pipelines Bot Sep 10, 2025
@microsoft microsoft deleted a comment from azure-pipelines Bot Sep 10, 2025
@microsoft microsoft deleted a comment from azure-pipelines Bot Sep 10, 2025
@microsoft microsoft deleted a comment from azure-pipelines Bot Sep 10, 2025
@microsoft microsoft deleted a comment from azure-pipelines Bot Sep 10, 2025
@bewithgaurav
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@microsoft microsoft deleted a comment from azure-pipelines Bot Sep 10, 2025
@bewithgaurav
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

- Convert lhs_params/rhs_params to tuples early to prevent TypeError
  when compiler.compile() returns mixed list/tuple param types
- Remove redundant tuple() calls in both DateField and else branches
- Add comment explaining the normalization
- Add 8 unit tests covering: both-tuples, both-lists, mixed list+tuple,
  empty params, DateField path, and DateTimeField path
@bewithgaurav
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@bewithgaurav
Copy link
Copy Markdown
Collaborator

Hey @PawelKawula - thanks for the detailed bug report on #368 and for putting this fix together - great catch on the mixed list/tuple params issue.

Heads up: we already included the core subtract_temporals tuple normalization fix as part of #507 (which landed on dev) & now live with out latest release v1.7, so this PR now adds the inline comments and 8 regression unit tests on top of that.

we'd love to merge this for the test coverage. Before we can, the CLA bot needs you to agree to the Contributor License Agreement - requesting you to please reply to the bot's comment above with:

Once that's done we'll get this merged. Thanks again :)

@PawelKawula
Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@bewithgaurav bewithgaurav changed the title FIX: fixed error when subtracting DateTime fields (#368) CHORE: Added tests for subtraction of DateTime fields (#368) Apr 22, 2026
@bewithgaurav bewithgaurav merged commit bd99ece into microsoft:dev Apr 22, 2026
62 checks passed
@bewithgaurav bewithgaurav mentioned this pull request Apr 24, 2026
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.

3 participants