-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat(): add support for DateOnly and TimeOnly #680 #734
feat(): add support for DateOnly and TimeOnly #680 #734
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this @joefeser!
Some relatively small issues other than those already commented in particular files:
- Looks like there's a compile error with the change in SDK.
- Please add an entry to the CHANGELOG.md under the
### Added
section - The DCO check requires commits to be signed off, you can do this for your existing commits via
git rebase HEAD~2 --signoff
and then make sure to pass--signoff
to any future commits for this repo
@@ -1,10 +1,10 @@ | |||
{ | |||
"sdk": { | |||
"version": "6.0.403", | |||
"version": "8.0.107", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The github workflow setup-dotnet
steps can be updated to change the sdk versions being installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
#if NETSTANDARD2_1 | ||
public static PostData ReadOnlyMemory(ReadOnlyMemory<byte> bytes) => new PostData<object>(bytes); | ||
#if NETSTANDARD2_1 || NET6_0_OR_GREATER | ||
public static PostData ReadOnlyMemory(ReadOnlyMemory<byte> bytes) => new PostData<object>(bytes.ToArray()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the .ToArray()
, this should be using the constructor here: https://github.com/opensearch-project/opensearch-net/blob/main/src/OpenSearch.Net/Transport/PostData.cs#L149
You'll just need to update the #if
s further down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understood this comment, it is in this commit bcbd1a2
#pragma warning disable IDE1006 // Naming Styles | ||
#pragma warning disable IDE0044 // Add readonly modifier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move these #pragma
s below the license header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved
Working on the changes as we speak. Thank you for being so proactive on my PR |
…nsearch-project#680 Signed-off-by: Joe Feser <[email protected]>
…project#680 Signed-off-by: Joe Feser <[email protected]>
Signed-off-by: Joe Feser <[email protected]>
0133685
to
d42bfd3
Compare
Signed-off-by: Joe Feser <[email protected]>
All of these tasks are completed |
8d69045
to
f58a134
Compare
Signed-off-by: Joe Feser <[email protected]>
f58a134
to
354cd61
Compare
Signed-off-by: Thomas Farr <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
Signed-off-by: Thomas Farr <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-734-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 f3bae74a0e5f7146127262b566259898d8a45ebc
# Push it to GitHub
git push --set-upstream origin backport/backport-734-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x Then, create a pull request where the |
…pensearch-project#734) * feat(): add .net6 and .net8 to core project and get it to compile opensearch-project#680 Signed-off-by: Joe Feser <[email protected]> * feat(): add support for DateOnly and TimeOnly from .net 6 opensearch-project#680 Signed-off-by: Joe Feser <[email protected]> * PR Comments Signed-off-by: Joe Feser <[email protected]> * PR Comments Signed-off-by: Joe Feser <[email protected]> * modified the added section of changelog.md Signed-off-by: Joe Feser <[email protected]> * Fix compilation/indentation error Signed-off-by: Thomas Farr <[email protected]> * Fix code conventions unit test Signed-off-by: Thomas Farr <[email protected]> * Fix remaining `#if`s Signed-off-by: Thomas Farr <[email protected]> * Fix changelog ordering Signed-off-by: Thomas Farr <[email protected]> * Fix CI errors Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Joe Feser <[email protected]> Signed-off-by: Thomas Farr <[email protected]> Co-authored-by: Thomas Farr <[email protected]> (cherry picked from commit f3bae74)
Thank you for this @joefeser, would you mind making a follow up PR adding the DateOnly and TimeOnly types into the unit test here: https://github.com/opensearch-project/opensearch-net/blob/main/tests/Tests.Reproduce/DateSerialization.cs |
@Xtansia I will add it in the next few days. I wasn't sure where to write the tests. I am going to do a POC also to add NodaTime support and at least get that conversation going |
* feat(): add .net6 and .net8 to core project and get it to compile #680 Signed-off-by: Joe Feser <[email protected]> * feat(): add support for DateOnly and TimeOnly from .net 6 #680 Signed-off-by: Joe Feser <[email protected]> * PR Comments Signed-off-by: Joe Feser <[email protected]> * PR Comments Signed-off-by: Joe Feser <[email protected]> * modified the added section of changelog.md Signed-off-by: Joe Feser <[email protected]> * Fix compilation/indentation error Signed-off-by: Thomas Farr <[email protected]> * Fix code conventions unit test Signed-off-by: Thomas Farr <[email protected]> * Fix remaining `#if`s Signed-off-by: Thomas Farr <[email protected]> * Fix changelog ordering Signed-off-by: Thomas Farr <[email protected]> * Fix CI errors Signed-off-by: Thomas Farr <[email protected]> --------- Signed-off-by: Joe Feser <[email protected]> Signed-off-by: Thomas Farr <[email protected]> Co-authored-by: Thomas Farr <[email protected]> (cherry picked from commit f3bae74) Co-authored-by: Joe Feser <[email protected]>
I have played a bit with this PR and I think we still have some likely problems :
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
} instead of something with
I tried fixing this second issue and for On the other hand for case "TimeOnly":
return new DateProperty()
{
Format = "strict_hour_minute_second_millis"
}; seems unsuccesful (for some reasons, doing PS : I pulled the value for |
Description
Add support for DateOnly and TimeOnly that were both added in .net 6
Issues Resolved
Closes #680.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.