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

Extend ToBoolean function so it casts "t" to true and "f" to false. #1620

Merged
merged 3 commits into from Jan 8, 2024

Conversation

DavIvek
Copy link
Contributor

@DavIvek DavIvek commented Jan 5, 2024

User from community requested this extension for ToBoolean function. Since, e.g., postgresql COPY to CSV will record true values as "t" and false values as "f".
We also might need to update documentation so it's clear what values ToBoolean casts to true or false.

[master < Task] PR

  • Check, and update documentation if necessary
  • Provide the full content or a guide for the final git message

To keep docs changelog up to date, one more thing to do:

  • Write a release note here, including added/changed clauses
  • Tag someone from docs team in the comments

Release note: Strings "t" and "f" are now resolved into true and false.

closes #1538

@DavIvek DavIvek added community community Docs needed Docs needed labels Jan 5, 2024
@DavIvek DavIvek self-assigned this Jan 5, 2024
@DavIvek
Copy link
Contributor Author

DavIvek commented Jan 5, 2024

NOTE: ToBoolean(t) will still return an error since it's resolved as a symbol. It doesn't make sense to me to resolve it as a boolean value.
The same thing is with boolean values not being resolved as symbols.
For example let's say we want to match a node from a database:
MATCH (truE:Node) return truE;
After executing above query we will get n rows (n being a number of nodes with label Node) of true values. truE won't get resolved into a symbol.

@DavIvek DavIvek marked this pull request as ready for review January 5, 2024 17:03
Copy link
Contributor

@imilinovic imilinovic left a comment

Choose a reason for hiding this comment

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

Looks good

@DavIvek DavIvek merged commit bd11266 into master Jan 8, 2024
6 checks passed
@DavIvek DavIvek deleted the extend-toboolean-function branch January 8, 2024 12:17
@vpavicic vpavicic added this to the mg-v2.14.0 milestone Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community Docs needed Docs needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ToBoolean casts the strings "t" and "f" to null
4 participants