Skip to content

Allow nanoseconds unix epoch, and numeric literal after year format#1648

Open
titaneric wants to merge 13 commits into
chronotope:mainfrom
titaneric:feat/consume-non-greedy-numeric
Open

Allow nanoseconds unix epoch, and numeric literal after year format#1648
titaneric wants to merge 13 commits into
chronotope:mainfrom
titaneric:feat/consume-non-greedy-numeric

Conversation

@titaneric

Copy link
Copy Markdown

This PR aims to resolve issue #560 and #1399 based on PR #561, and the multiple issues from vector such as vectordotdev/vrl#117, vectordotdev/vrl#790
Since there is no any respones from the author of #561, I would like to continue his/her work.

@codecov

codecov Bot commented Jan 11, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.07%. Comparing base (97f758f) to head (1922a29).
⚠️ Report is 105 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1648      +/-   ##
==========================================
+ Coverage   90.87%   91.07%   +0.19%     
==========================================
  Files          37       37              
  Lines       17143    17459     +316     
==========================================
+ Hits        15579    15901     +322     
+ Misses       1564     1558       -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@titaneric

Copy link
Copy Markdown
Author

@meiamsome , @pitdicker , @djc, @jszwedko , sorry to ping you here since you have discussed the topic in #561 , but I would like to hear any comments to my PR.

@jszwedko

Copy link
Copy Markdown

@meiamsome , @pitdicker , @djc, @jszwedko , sorry to ping you here since you have discussed the topic in #561 , but I would like to hear any comments to my PR.

I'll defer comments on the implementation since I'm not super familiar with chrono internals, but the tests look good to me. Thanks for attempting to fix this!

@djc

djc commented Jan 22, 2025

Copy link
Copy Markdown
Member

I don't like these changes much. They seem to be very focused on just passing the added tests and don't even try to clean up the surrounding code to understand that the underlying motivation is clearly addressed.

@titaneric

Copy link
Copy Markdown
Author

Present implementation heavily depends on previous attempted PR and one of the comment. I substract the next possible numerical literal to count the actual token size for either year or timestamp, that's two phase calculation but would only happen in the special case.

Are you saying that I need to do more work to the parse_internal function? Trying to calculate the token size with one-phase only?

@djc

djc commented Jan 24, 2025

Copy link
Copy Markdown
Member

Are you saying that I need to do more work to the parse_internal function? Trying to calculate the token size with one-phase only?

I am saying that I as the maintainer don't find the presented changes an improvement in clarity to already pretty convoluted code. I won't pretend to know exactly how to solve it, which would take me a bunch more time which I'm not really motivated to spend unless some funding is available.

@titaneric

Copy link
Copy Markdown
Author

I have refactored the implementation a little bit, hopefully it could make the code more readable and concise.
Please review it whenever you are available.

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