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

GH-21815: [JS] Add support for Duration type #37341

Merged
merged 11 commits into from
Sep 28, 2023

Conversation

FrNecas
Copy link
Contributor

@FrNecas FrNecas commented Aug 23, 2023

Rationale for this change

The Duration type is currently not supported and trying to deserialize a Table containing the type (e.g. using tableFromIPC) fails with Unrecognized type error. This PR aims to fix that.

What changes are included in this PR?

  • definition of the Duration data type
  • updates to the visitor classes so that things like parsing work correctly
  • test coverage for the type
  • documentation update

Are these changes tested?

Yes, I extended the data generator with the new type so that the type is tested by the existing tests.

Are there any user-facing changes?

Yes, I've updated the documentation status page. I also noticed that it was outdated for JavaScript, i.e. there is already support for Decimal type so I updated this as well.

Closes: #21815
Closes: #35439

@github-actions
Copy link

⚠️ GitHub issue #21815 has been automatically assigned in GitHub to PR creator.

Copy link
Contributor

@trxcllnt trxcllnt left a comment

Choose a reason for hiding this comment

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

Very thorough, looks great. Approving with a few minor comments.

js/src/visitor/get.ts Show resolved Hide resolved
js/src/visitor/get.ts Show resolved Hide resolved
js/src/visitor/set.ts Show resolved Hide resolved
js/src/visitor/set.ts Show resolved Hide resolved
@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Aug 24, 2023
@FrNecas
Copy link
Contributor Author

FrNecas commented Aug 24, 2023

@trxcllnt thanks for the very quick review! Hm, these set* functions are used in the sub-builders:

(DurationSecondBuilder.prototype as any)._setValue = setDurationSecond;

And if we shortened this like you proposed, the typing would get wider, wouldn't it? Because then DurationSecondBuilder._setValue would accept all these Duration* types (feel free to correct me on this, I am not a JS/TS expert). It wouldn't break the runtime functionality but the type-checking may be too forgiving? For this reason, I think at least for set*, we should keep it this way. The get* methods aren't used in such a way so we could simplify it there but maybe it's better to keep it for consistency reasons (consistency with the other types, e.g. Interval and also consistency with the set* methods so that it's symmetrical).

What do you think about this?

@FrNecas
Copy link
Contributor Author

FrNecas commented Aug 24, 2023

Hm, looking into this made me find a copy-paste bug I made.

@trxcllnt
Copy link
Contributor

@FrNecas good point, I forgot they were used in other places. I'm not sure if TS would accept the wider types without testing. Even if it does, that seems like the sort of rule-bending that TS likes to break across releases, so what you have now is fine with me.

docs/source/status.rst Outdated Show resolved Hide resolved
@pitrou
Copy link
Member

pitrou commented Aug 24, 2023

@FrNecas Can you also update the integration skips here so that we make sure JS interops with other implementations?

generate_duration_case()
.skip_category('C#')
.skip_category('JS'), # TODO(ARROW-5239): Intervals + JS
generate_interval_case()
.skip_category('C#')
.skip_category('JS'), # TODO(ARROW-5239): Intervals + JS

@pitrou
Copy link
Member

pitrou commented Aug 24, 2023

The integration CI job has failed for disk space issues, I have restarted it in the hope that it'll pass this time.

@FrNecas
Copy link
Contributor Author

FrNecas commented Aug 24, 2023

Looks like the NodeJS / AMD64 Debian 11 NodeJS 18 (pull_request) check timed out? But tests seem to be passing it just takes quite long 🤔

@pitrou
Copy link
Member

pitrou commented Aug 24, 2023

Ok, the integration tests failed with the JS handling of intervals...
https://github.com/apache/arrow/actions/runs/5966046880/job/16185712960?pr=37341#step:7:16341

@FrNecas
Copy link
Contributor Author

FrNecas commented Aug 24, 2023

Hm, ok, in that case let's mark intervals as unsupported and skip that test again for now and maybe create a separate issue to look into this

@github-actions
Copy link

⚠️ GitHub issue #21815 has been automatically assigned in GitHub to PR creator.

@FrNecas
Copy link
Contributor Author

FrNecas commented Aug 29, 2023

Could someone please try to re-run the one failing job? There doesn't seem to be anything actionable (looks like a timeout) and I think I saw this one fail already but then it passed later when it was re-run.

@raulcd
Copy link
Member

raulcd commented Aug 29, 2023

@github-actions crossbow submit js

@github-actions
Copy link

Revision: 96e94e2

Submitted crossbow builds: ursacomputing/crossbow @ actions-a1d46eeed2

Task Status
verify-rc-source-js-linux-almalinux-8-amd64 Github Actions
verify-rc-source-js-linux-conda-latest-amd64 Github Actions
verify-rc-source-js-linux-ubuntu-20.04-amd64 Github Actions
verify-rc-source-js-linux-ubuntu-22.04-amd64 Github Actions
verify-rc-source-js-macos-amd64 Github Actions
verify-rc-source-js-macos-arm64 Github Actions

@FrNecas
Copy link
Contributor Author

FrNecas commented Sep 21, 2023

Hello, is there anything else that I need to do in order for this PR to get merged? It's been some time since it was approved so I am wondering if it didn't slip through the cracks.

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Sep 28, 2023
@domoritz domoritz merged commit befcc90 into apache:main Sep 28, 2023
12 checks passed
@domoritz domoritz removed the awaiting merge Awaiting merge label Sep 28, 2023
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit befcc90.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them.

JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Oct 23, 2023
### Rationale for this change

The `Duration` type is currently not supported and trying to deserialize a Table containing the type (e.g. using `tableFromIPC`) fails with `Unrecognized type` error. This PR aims to fix that.

### What changes are included in this PR?

- definition of the `Duration` data type
- updates to the visitor classes so that things like parsing work correctly
- test coverage for the type
- documentation update

### Are these changes tested?

Yes, I extended the data generator with the new type so that the type is tested by the existing tests.

### Are there any user-facing changes?

Yes, I've updated the documentation status page. I also noticed that it was outdated for JavaScript, i.e. there is already support for `Decimal` type so I updated this as well.

Closes: apache#21815
Closes: apache#35439
* Closes: apache#21815

Lead-authored-by: František Necas <[email protected]>
Co-authored-by: ptaylor <[email protected]>
Signed-off-by: Dominik Moritz <[email protected]>
JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Oct 23, 2023
### Rationale for this change

The `Duration` type is currently not supported and trying to deserialize a Table containing the type (e.g. using `tableFromIPC`) fails with `Unrecognized type` error. This PR aims to fix that.

### What changes are included in this PR?

- definition of the `Duration` data type
- updates to the visitor classes so that things like parsing work correctly
- test coverage for the type
- documentation update

### Are these changes tested?

Yes, I extended the data generator with the new type so that the type is tested by the existing tests.

### Are there any user-facing changes?

Yes, I've updated the documentation status page. I also noticed that it was outdated for JavaScript, i.e. there is already support for `Decimal` type so I updated this as well.

Closes: apache#21815
Closes: apache#35439
* Closes: apache#21815

Lead-authored-by: František Necas <[email protected]>
Co-authored-by: ptaylor <[email protected]>
Signed-off-by: Dominik Moritz <[email protected]>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
### Rationale for this change

The `Duration` type is currently not supported and trying to deserialize a Table containing the type (e.g. using `tableFromIPC`) fails with `Unrecognized type` error. This PR aims to fix that.

### What changes are included in this PR?

- definition of the `Duration` data type
- updates to the visitor classes so that things like parsing work correctly
- test coverage for the type
- documentation update

### Are these changes tested?

Yes, I extended the data generator with the new type so that the type is tested by the existing tests.

### Are there any user-facing changes?

Yes, I've updated the documentation status page. I also noticed that it was outdated for JavaScript, i.e. there is already support for `Decimal` type so I updated this as well.

Closes: apache#21815
Closes: apache#35439
* Closes: apache#21815

Lead-authored-by: František Necas <[email protected]>
Co-authored-by: ptaylor <[email protected]>
Signed-off-by: Dominik Moritz <[email protected]>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
### Rationale for this change

The `Duration` type is currently not supported and trying to deserialize a Table containing the type (e.g. using `tableFromIPC`) fails with `Unrecognized type` error. This PR aims to fix that.

### What changes are included in this PR?

- definition of the `Duration` data type
- updates to the visitor classes so that things like parsing work correctly
- test coverage for the type
- documentation update

### Are these changes tested?

Yes, I extended the data generator with the new type so that the type is tested by the existing tests.

### Are there any user-facing changes?

Yes, I've updated the documentation status page. I also noticed that it was outdated for JavaScript, i.e. there is already support for `Decimal` type so I updated this as well.

Closes: apache#21815
Closes: apache#35439
* Closes: apache#21815

Lead-authored-by: František Necas <[email protected]>
Co-authored-by: ptaylor <[email protected]>
Signed-off-by: Dominik Moritz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants