Skip to content

Conversation

@atombrella
Copy link
Contributor

@atombrella atombrella commented Dec 1, 2024

Description

https://docs.astral.sh/ruff/rules/native-literals/

Fixed using

ruff check --exclude="script*" --exclude="tools*" --select "UP018" --fix

Performance improvements:

In [1]: %timeit b""
6.85 ns ± 0.222 ns per loop (mean ± std. dev. of 7 runs, 100,000,000 loops each)

In [2]: %timeit bytes()
41.1 ns ± 0.245 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)

In [3]: %timeit "Azure"
6.75 ns ± 0.037 ns per loop (mean ± std. dev. of 7 runs, 100,000,000 loops each)

In [4]: %timeit str("Azure")
25.8 ns ± 0.124 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Fixed using
ruff check --exclude="script*" --exclude="tools*" --select "UP018" --fix
@github-actions github-actions bot added Community Contribution Community members are working on the issue Confidential Ledger customer-reported Issues that are reported by GitHub users external to the Azure organization. Event Hubs Monitor - Exporter Monitor OpenTelemetry Exporter Service Bus Storage Storage Service (Queues, Blobs, Files) labels Dec 1, 2024
@github-actions
Copy link

github-actions bot commented Dec 1, 2024

Thank you for your contribution @atombrella! We will review the pull request and get back to you soon.

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@l0lawrence
Copy link
Member

Hi @atombrella thank you for the pr! For SB/EH this looks good to me

The CI failures seem to be pre-existing failures in the confidential-ledger pipeline.

@atombrella
Copy link
Contributor Author

@l0lawrence @kashifkhan Just to remind you, I do not have merge rights

Copy link
Member

@vincenttran-msft vincenttran-msft left a comment

Choose a reason for hiding this comment

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

LGTM for Storage side in regards to bytes() -> b"", thanks for this!

Copy link
Contributor

@kristapratico kristapratico left a comment

Choose a reason for hiding this comment

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

Thanks @atombrella! This looks good to me

@kristapratico
Copy link
Contributor

/check-enforcer override

Pylint failure in confidential ledger is unrelated

@kristapratico kristapratico merged commit 77f5443 into Azure:main Dec 6, 2024
40 of 43 checks passed
@atombrella atombrella deleted the pyupgrade/up018_literals branch December 8, 2024 15:25
l0lawrence pushed a commit to l0lawrence/azure-sdk-for-python that referenced this pull request Feb 19, 2025
Fixed using
ruff check --exclude="script*" --exclude="tools*" --select "UP018" --fix

Co-authored-by: Mads Jensen <atombrella@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution Community members are working on the issue Confidential Ledger customer-reported Issues that are reported by GitHub users external to the Azure organization. Event Hubs Monitor - Exporter Monitor OpenTelemetry Exporter Service Bus Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants