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

Add DateTimeOffset for Csv Schema Inference #1304

Merged
merged 9 commits into from
Oct 4, 2020

Conversation

nhirschey
Copy link
Contributor

The goal is to allow specifying

type MyCsvType =
  CsvProvider<Schema = "A (int), B  (datetimeoffset option)",
    HasHeaders=false>

The changes are in lines 22, 32, and 41. The rest of the differences are whitespace edits to keep formatting consistent with the prior style of lining everything up vertically.

The changes are in lines 22, 32, and 41. The rest is whitespace edits to keep formatting consistent with the prior style of lining everything up vertically.
@NickDarvey
Copy link

What's required to get this merged?

@nhirschey
Copy link
Contributor Author

The maintainers probably want to chime in on the Date schema API. The default was changed date for the provider was changed to DateTimeOffset in the 3.X move, but none of the schema code was updated to correspond.

An alternative to my changes here would be to change the old code so that 'date' implies DateTimeOffset rather than DateTime. I think having the date schema imply DateTimeOffset might make more sense given the current DateTimeOffset default, but that causes backwards compatibility issues and was forgotten in the 2.x (DateTime default) -> 3.X (DateTimeOffset) move.

@dsyme
Copy link
Contributor

dsyme commented Jul 6, 2020

What's required to get this merged?

The change looks fine, can you add test cases for this?

@nhirschey
Copy link
Contributor Author

nhirschey commented Jul 7, 2020 via email

@nhirschey
Copy link
Contributor Author

I think this is now ready.

Additions:

  • Add DateTimeOffset to structural types, which was required to get inference working correctly.
  • I added a test to make sure that the schema inference was working correctly, for example when parsing name (datetimeoffset option) and name (datetimeoffset?).
  • I updated the schema inferencing documentation for CsvProvider to account for the changes.

This set of commits depends on another pull request (#1320), which has changes necessary to get the build working.

@dsyme dsyme merged commit 478803d into fsprojects:master Oct 4, 2020
@nhirschey nhirschey deleted the allow-datetimeoffset-schema branch December 2, 2020 01:21
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