Skip to content

Conversation

@longemen3000
Copy link
Contributor

JuliaLang/julia#53896 removed Base.wrap, and i did use that to fix CSV in the last patch. This now uses view(x::Memory,len) instead.

fixes #1132


if isdefined(Base,:wrap)
__wrap(x,pos) = Base.wrap(Array,x,pos)
if isdefined(Base, :Memory)
Copy link
Contributor

Choose a reason for hiding this comment

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

can't you get rid of this entire function and just make it use view

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i want view(x::Array) return x, and view(x::Memory) does not work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

or do you mean in the function getbytebuffer itself?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, this function only has one use and now that view isn't a new name from base you can just use it without the check.

@codecov
Copy link

codecov bot commented Apr 9, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 90.41%. Comparing base (acd36a6) to head (eafb38b).

Files Patch % Lines
src/utils.jl 33.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1133      +/-   ##
==========================================
+ Coverage   90.12%   90.41%   +0.29%     
==========================================
  Files           9        9              
  Lines        2309     2338      +29     
==========================================
+ Hits         2081     2114      +33     
+ Misses        228      224       -4     

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

@Keno
Copy link

Keno commented Apr 9, 2024

I'd like to go ahead and merge this to fix the regression on master. If there's additional simplification to be had, let's do a follow up PR.


if isdefined(Base,:wrap)
__wrap(x,pos) = Base.wrap(Array,x,pos)
if isdefined(Base, :Memory)

Choose a reason for hiding this comment

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

Julia 1.11 also has Base.Memory (but not the recent wrap rename) - Will this PR be backwards compatible?

Copy link
Contributor

Choose a reason for hiding this comment

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

the wrap->view will be back-ported to 1.11

Copy link

Choose a reason for hiding this comment

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

It seems rude to break people on the current RC. Can we put in appropriate checks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add an extra if for the case that Memory and wrap is defined

@ViralBShah
Copy link
Contributor

I'm merging to fix the breakage - and perhaps further improvements can follow.

@ViralBShah ViralBShah merged commit 67424ce into JuliaData:main Apr 9, 2024
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.

CSV is broken in nightly julia

5 participants