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

Enable Single Quote Support in getJSONObject API with GetJsonObjectOptions #10407

Merged

Conversation

SurajAralihalli
Copy link
Collaborator

Resolves issue 10219
Depends on Cudf PR 14956

The PR 14956 adds GetJsonObjectOptions to the getJSONObject API. By default, single quote support is turned off. This pull request enables the single quote option in all instances of getJSONObject by including the options argument in the function call.

Note: PR 14956 ensures backward compatibility, allowing this PR to be merged at any time following the completion of PR 14956.

Signed-off-by: Suraj Aralihalli <[email protected]>
@sameerz sameerz added the bug Something isn't working label Feb 11, 2024
Copy link
Collaborator

@revans2 revans2 left a comment

Choose a reason for hiding this comment

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

Can we add in a few test cases to verify that it is working?

@@ -50,6 +50,19 @@ def test_get_json_object_quoted_index():
f.get_json_object('jsonStr',r'''$['b']''').alias('sub_b')),
conf={'spark.rapids.sql.expression.GetJsonObject': 'true'})

def test_get_json_object_single_quotes():
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@revans2 Added test_get_json_object_single_quotes. This test would fail when .allowSingleQuotes(false).

Copy link
Collaborator

@revans2 revans2 left a comment

Choose a reason for hiding this comment

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

Looks great

@revans2
Copy link
Collaborator

revans2 commented Feb 13, 2024

build

@SurajAralihalli SurajAralihalli marked this pull request as ready for review February 13, 2024 16:28
@revans2 revans2 merged commit ed5e6b4 into NVIDIA:branch-24.04 Feb 13, 2024
39 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants