-
Notifications
You must be signed in to change notification settings - Fork 98
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
Added support for 2 date formats: #70
Conversation
1. `epoch_millis` 2. `epoch_seconds` When the mapping are fetched each date type will carry additional format information. Ex. date[epoch_millis], date[epoch_second], etc. This will later on be converted to pandas types according to their format: datetime64[ms], datetime64[s]
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.
A large number of existing tests fail with this PR - please always make sure all tests pass before submitting (via ci or manually).
No tests are supplied with this PR - please add tests.
ok. checking it, thanks! |
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.
As described in previous comment, we should try to write tests first and then develop code against these tests.
Also, can we not map the es_dtype/format to the appropriate pd.to_datetime arguments in mappings, so we can avoid this code in flatten
.
Another thing we may want to consider is if we should parse doc_values for datetime rather than _source. For example, how would we resolve this:
|
This reverts commit 28282fc.
@stevedodson another question I have is: I noticed that by default date is mapped to |
* adds support for __add__ ops for string objects and literals * adds tests for string arithmetic * updates comment in numeric field resolution * adds op_type parameter for numeric_ops
@viglia - for now I'd look to implement the simplest way to supported epoch_millis as a format + test against other common formats (e.g. the ones that contains date and time). Having the default map to |
…res in low level Python socket module
…g and avoid repulling dependencies in requirements.txt if they don't change
…5.1 is not compatible with Python 3.8 and Pandas 0.25.2 is breaking some eland tests
…sions to test_matrix.yml
The following formats are currently explicitly supported: 1. implicit: epoch_millis (no format defined) 2. implicit: strict_date_optional_time (no format defined) 3. explicit: epoch_millis 4. explicit: epoch_second In order to keep track of the format of the different date fields, a new instance attribute `_date_fields_format` has been added to Mappings Support for further formats can be handled by adding new cases to the `eland_date_to_pandas_date` function in the `date_utils.py` file
FYI - It is good to test multiple time formats in a single index alongside a single time format.
|
@blaklaybul don't worry about review at this stage - I clicked incorrect reviewer in UI. |
From slack: The implementation of this should be very simple. In
etc. |
@viglia + please merge with master. Thanks! |
Francesco Vigliaturo 8:58 AM Steve Dodson 9:02 AM |
Adds support to multiple date formats and a test case that tests all of this formats Currently the test fails. Pushing this commit to facilitate debugging and share the current code
Some %G formats explicitly not supported.
@viglia - please add support for all non 'strict_' formats. |
1. removed index creation from setup_tests and added proper setup_class and tear_down class 2. added support for non-strict dates in query_compile and in tests
Hi @stevedodson I've addressed all the feedback left. Let me know if I missed anything. Regarding this one:
I did not merged them and I've kept Ps. I've also run all the tests and everything run fine. I'm going to check what Jenkins complains about |
1. `epoch_millis` 2. `epoch_seconds` When the mapping are fetched each date type will carry additional format information. Ex. date[epoch_millis], date[epoch_second], etc. This will later on be converted to pandas types according to their format: datetime64[ms], datetime64[s]
This reverts commit 28282fc.
Please merge into master! |
The following formats are currently explicitly supported: 1. implicit: epoch_millis (no format defined) 2. implicit: strict_date_optional_time (no format defined) 3. explicit: epoch_millis 4. explicit: epoch_second In order to keep track of the format of the different date fields, a new instance attribute `_date_fields_format` has been added to Mappings Support for further formats can be handled by adding new cases to the `eland_date_to_pandas_date` function in the `date_utils.py` file
1. All the handling of the date formatting has been moved into the 'eland_date_to_pandas_date' in date_utils.py Also, 'eland_date_to_pandas_date' now returns the parsed date and not an anonymous function. 2. a warning has been added in cases where the user is using a date formatting that we don't support explicitly 3. a log was added to the new indices setup
Adds support to multiple date formats and a test case that tests all of this formats Currently the test fails. Pushing this commit to facilitate debugging and share the current code
Some %G formats explicitly not supported.
1. removed index creation from setup_tests and added proper setup_class and tear_down class 2. added support for non-strict dates in query_compile and in tests
@viglia - next time please wait until the PR is approved before merging. |
@stevedodson sorry for the misunderstanding! I've read your comment above |
This PR addresses #22 by adding support for 2 date formats:
epoch_millis
epoch_seconds
When the mapping are fetched each date type will carry additional format information.
Ex. date[epoch_millis], date[epoch_second], etc.
This will later on be converted to pandas types according to their format: datetime64[ms], datetime64[s]