Skip to content

Add polyfills to make apache-arrow work in Node@14 #219

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

Merged
merged 4 commits into from
Jan 25, 2024

Conversation

kravets-levko
Copy link
Contributor

@kravets-levko kravets-levko commented Jan 22, 2024

After upgrading apache-arrow in #180 (which was needed to fix #150), this library stopped working in some Nodejs versions. Turns out that apache-arrow@13 started to massively use Array.at/TypedArray.at methods which became available only in Node@16.6.0.

Even if we forget that apache-arrow declares a support for Node@12 (at least in its package.json file), we had two options:

  1. stop supporting older Nodejs versions;
  2. add polyfills for missing methods.

I ended up implementing own polyfill with this reasoning:

  1. we still have users that use Node 16 or even 14 (but for option 1 we'd have to declare support for even newer versions);
  2. basically, only one method is currently needed (Array.at/TypedArray.at can use same implementation);
  3. the needed method is really simple (so even using core-js would be absolute overkill).

Signed-off-by: Levko Kravets <levko.ne@gmail.com>
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (086f5bb) 90.41% compared to head (dd20df9) 90.51%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #219      +/-   ##
==========================================
+ Coverage   90.41%   90.51%   +0.10%     
==========================================
  Files          61       62       +1     
  Lines        1408     1423      +15     
  Branches      232      238       +6     
==========================================
+ Hits         1273     1288      +15     
  Misses         84       84              
  Partials       51       51              

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

@kravets-levko kravets-levko merged commit 8c590d7 into main Jan 25, 2024
@kravets-levko kravets-levko deleted the node14-compatibility branch January 25, 2024 09:08
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.

scientific notation negative numbers
3 participants