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

Fix csv.py parser mappings #5602

Merged
merged 1 commit into from
Jun 11, 2024
Merged

Conversation

devinrsmith
Copy link
Member

@devinrsmith devinrsmith commented Jun 11, 2024

Fixes #5601

@devinrsmith
Copy link
Member Author

This is incomplete, because it looks like there is a bug in the underlying deephaven-csv layer. See the issue for details.

@devinrsmith devinrsmith added this to the 3. May 2024 milestone Jun 11, 2024
@devinrsmith devinrsmith self-assigned this Jun 11, 2024
@devinrsmith devinrsmith marked this pull request as ready for review June 11, 2024 20:45
@devinrsmith
Copy link
Member Author

devinrsmith commented Jun 11, 2024

My earlier assessment that there was a bug in the lower layer only applies to reserved keywords as column names. Will file a bug there.

@@ -75,9 +75,9 @@ def read(
dht.byte: _JParsers.BYTE,
dht.char: _JParsers.CHAR,
dht.short: _JParsers.SHORT,
dht.int64: _JParsers.INT,
Copy link
Contributor

Choose a reason for hiding this comment

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

This disables support for dht.int64 and dht.float64. That seems more accurate, but how many users will it affect?

Copy link
Member Author

Choose a reason for hiding this comment

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

dht.int64 == dht.long, dht.float64 == dht.double; they are present lower down in the map.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm afraid I don't see dht.int64, dht.float64, dht.int16 or dht.int8 anywhere in this file. What file is that in?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I see it. This is an object map, so you only need one variable that points to the object to be represented. So in dtypes.py, both int64 and long point to the same DType object, so you only need one represented in the map.

@@ -75,9 +75,9 @@ def read(
dht.byte: _JParsers.BYTE,
dht.char: _JParsers.CHAR,
dht.short: _JParsers.SHORT,
dht.int64: _JParsers.INT,
dht.int32: _JParsers.INT,
dht.long: _JParsers.LONG,
Copy link
Member

Choose a reason for hiding this comment

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

Do int64 and float64 correctly map to long and double?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, they are the same objects.

Copy link
Contributor

@jmao-denver jmao-denver left a comment

Choose a reason for hiding this comment

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

LGTM

@devinrsmith devinrsmith enabled auto-merge (squash) June 11, 2024 21:13
@@ -75,9 +75,9 @@ def read(
dht.byte: _JParsers.BYTE,
dht.char: _JParsers.CHAR,
dht.short: _JParsers.SHORT,
dht.int64: _JParsers.INT,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm afraid I don't see dht.int64, dht.float64, dht.int16 or dht.int8 anywhere in this file. What file is that in?

@@ -75,9 +75,9 @@ def read(
dht.byte: _JParsers.BYTE,
dht.char: _JParsers.CHAR,
dht.short: _JParsers.SHORT,
dht.int64: _JParsers.INT,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I see it. This is an object map, so you only need one variable that points to the object to be represented. So in dtypes.py, both int64 and long point to the same DType object, so you only need one represented in the map.

@devinrsmith devinrsmith merged commit 2e5f72c into deephaven:main Jun 11, 2024
15 of 21 checks passed
@devinrsmith devinrsmith deleted the csv-mappings branch June 11, 2024 21:28
@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSV Read Fails on dtypes.int32 After Recent int_ Removal
4 participants