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

fix(t2viz): string escape should only escape field #325

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

ruanyl
Copy link
Member

@ruanyl ruanyl commented Sep 25, 2024

Description

  1. Only escape field which name is field
  2. Escape field when vega have different layers

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test.
  • New functionality has user manual doc added.
  • Commits are signed per the DCO using --signoff.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@@ -108,7 +108,8 @@ export class Text2Vega {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const escapeField = (json: any, field: string) => {
if (json[field]) {
if (typeof json[field] === 'string') {
// Only escape field which name is 'field'
if (typeof json[field] === 'string' && field === 'field') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we have a unit test to cover this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, unit tests for t2viz will come in a separate PR

@ruanyl ruanyl merged commit 64fb466 into opensearch-project:main Sep 25, 2024
9 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 25, 2024
Signed-off-by: Yulong Ruan <[email protected]>
(cherry picked from commit 64fb466)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
ruanyl pushed a commit that referenced this pull request Sep 25, 2024
Signed-off-by: Yulong Ruan <[email protected]>
(cherry picked from commit 64fb466)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Trigger the backport flow to 2.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants