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: sanitize hp strings #742

Merged
merged 2 commits into from
Oct 13, 2023
Merged

feat: sanitize hp strings #742

merged 2 commits into from
Oct 13, 2023

Conversation

ajberdy
Copy link
Contributor

@ajberdy ajberdy commented Oct 13, 2023

Issue #, if available:

Description of changes:

shorten long strings and replace forbidden chars with ?

Testing done:

unit and manual testing

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ajberdy ajberdy requested a review from kshitijc October 13, 2023 19:26
@ajberdy ajberdy requested a review from a team as a code owner October 13, 2023 19:27
@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (6fa0005) 100.00% compared to head (85260f4) 100.00%.

Additional details and impacted files
@@                   Coverage Diff                   @@
##           feature/job-decorator      #742   +/-   ##
=======================================================
  Coverage                 100.00%   100.00%           
=======================================================
  Files                        129       129           
  Lines                       8381      8387    +6     
  Branches                    1864      1866    +2     
=======================================================
+ Hits                        8381      8387    +6     
Files Coverage Δ
src/braket/jobs/hybrid_job.py 100.00% <100.00%> (ø)

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

.replace("\n", " ")
# replace forbidden characters with "?"
.replace("$", "?")
.replace("(", "?")
Copy link
Contributor

Choose a reason for hiding this comment

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

Would {} be a more natural replacement for ()?

# replace forbidden characters with "?"
.replace("$", "?")
.replace("(", "?")
.replace("&", "?")
Copy link
Contributor

Choose a reason for hiding this comment

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

Would amp; be a more natural replacement?

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 may prefer + to maintain the number of chars (for indexing and length constraints)

.replace("$", "?")
.replace("(", "?")
.replace("&", "?")
.replace("`", "?")
Copy link
Contributor

Choose a reason for hiding this comment

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

Would ' be a more natural replacement?

@ajberdy ajberdy requested a review from kshitijc October 13, 2023 20:42
@ajberdy ajberdy merged commit 0efbd82 into feature/job-decorator Oct 13, 2023
22 checks passed
@ajberdy ajberdy deleted the hp-strings branch October 13, 2023 21:34
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.

2 participants