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

[WIP] Translation of TimeOnly.FromTimeSpan on SQL Server no-op #34114

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kuznetsovvj
Copy link
Contributor

fix #34025

  • I've read the guidelines for contributing and seen the walkthrough
  • I've posted a comment on an issue with a detailed description of how I am planning to contribute and got approval from a member of the team
  • The code builds and tests pass locally (also verified by our automated build checks)
  • Commit messages follow this format:
        Summary of the changes
        - Detail 1
        - Detail 2

        Fixes #bugnumber
  • Tests for the changes have been added (for bug fixes / features)
  • Code follows the same patterns and style as existing code in this repo

@kuznetsovvj
Copy link
Contributor Author

@dotnet-policy-service agree

@kuznetsovvj
Copy link
Contributor Author

Oh, I'll keep working on Pull Request, figure out why the CI tests aren't passing

@kuznetsovvj kuznetsovvj changed the title Translation of TimeOnly.FromTimeSpan on SQL Server no-op [WIP] Translation of TimeOnly.FromTimeSpan on SQL Server no-op Jul 3, 2024
…nlyMethodTranslator.cs

Co-authored-by: Andrea Canciani <[email protected]>
{
return _sqlExpressionFactory.Convert(arguments[0], typeof(TimeOnly));
return arguments[0].Type is typeof(TimeSpan)
Copy link
Contributor

Choose a reason for hiding this comment

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

my bad, my suggestion does not even compile 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that

Suggested change
return arguments[0].Type is typeof(TimeSpan)
return arguments[0].Type == typeof(TimeSpan)

might build... I will try it out tomorrow, so don't trust me on this (well, not yet 😇 )

Copy link
Contributor

Choose a reason for hiding this comment

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

It builds & passes the tests 🚀 (at least locally 😅 )

Copy link
Contributor

Choose a reason for hiding this comment

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

but those 3 tests require updates to the baselines in several files:

  • test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs
  • test/EFCore.SqlServer.FunctionalTests/Query/TPCGearsOfWarQuerySqlServerTest.cs
  • test/EFCore.SqlServer.FunctionalTests/Query/TPTGearsOfWarQuerySqlServerTest.cs
  • test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs

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.

Translation of TimeOnly.FromTimeSpan on SQL Server should be no-op.
2 participants