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

[feat] inArray and notInArray accept empty list #2502

Conversation

RemiPeruto
Copy link
Contributor

close #1295

Make inArray and notInArray methods accept an empty list as their second parameter instead of throwing an error :

  • inArray returns false when called with an empty list
  • notInArray returns true when called with an empty list

the comment referencing the choice of implementation in the thread

@RemiPeruto RemiPeruto force-pushed the feat/allow-empty-list-for-in-array-and-not-in-array branch from fc80d21 to a50ebc3 Compare June 13, 2024 08:13
@RemiPeruto
Copy link
Contributor Author

@philippdormann You reviewed the same changes back in march of this year in the MR #1664
If it is still ok for you could you please approve my MR to merge those changes.
Thanks a lot !

@ThomasAribart
Copy link

@RemiPeruto @AndriiSherman This PR would actually fix an issue in my project, could you review it please?

@AndriiSherman
Copy link
Member

Thanks a lot! It looks great and is ready to merge. However, if you can resolve the conflicts, that would be helpful.

I can explain why there are conflicts and what should be done. Previously, all tests were separated by drivers, and now we have a *.common.ts file, for example, tests/pg/pg.common.ts, where all tests for pg are located and will be run in each driver automatically. There is no need to copy tests through all the files

@RemiPeruto RemiPeruto force-pushed the feat/allow-empty-list-for-in-array-and-not-in-array branch 3 times, most recently from a50ebc3 to e1b9978 Compare July 19, 2024 14:40
@RemiPeruto
Copy link
Contributor Author

@AndriiSherman thanks a lot !
I corrected the conflicts.
Can you review please ?

@RemiPeruto RemiPeruto force-pushed the feat/allow-empty-list-for-in-array-and-not-in-array branch from e1b9978 to 8f97370 Compare July 22, 2024 16:08
@RemiPeruto
Copy link
Contributor Author

RemiPeruto commented Jul 22, 2024

@AndriiSherman Could you review it please ? It would be nice to have this feature. Like @ThomasAribart said, it will fix some issues in my project.

@AndriiSherman
Copy link
Member

@RemiPeruto Could you please format all the files that you changed so they can pass dprint checks?

@RemiPeruto
Copy link
Contributor Author

I am on it.

Make inArray and notInArray methods accept an empty list as their second parameter
@RemiPeruto RemiPeruto force-pushed the feat/allow-empty-list-for-in-array-and-not-in-array branch from 8f97370 to fb0868e Compare July 23, 2024 10:20
@AndriiSherman
Copy link
Member

Going to make a few releases today. This one will be included

@AndriiSherman AndriiSherman merged commit 222d30c into drizzle-team:main Jul 23, 2024
7 checks passed
@RemiPeruto RemiPeruto mentioned this pull request Jul 25, 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.

[FEATURE]: Allow to pass empty values to inArray
3 participants