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

chore(python): proper type hinting #3839

Merged
merged 12 commits into from
Oct 4, 2024
Merged

Conversation

Fluf22
Copy link
Contributor

@Fluf22 Fluf22 commented Sep 26, 2024

🧭 What and Why

🎟 JIRA Ticket: DI-3000 & DI-3005

Changes included:

  • Fix type hinting in python
  • Add pyright in the toolbox and trigger it at format run time

@Fluf22 Fluf22 requested a review from a team as a code owner September 26, 2024 16:42
@Fluf22 Fluf22 self-assigned this Sep 26, 2024
@algolia-bot
Copy link
Collaborator

algolia-bot commented Sep 26, 2024

✔️ Code generated!

Name Link
🪓 Triggered by 86ff6371ad231fd1a0ce99406967386860e7a995
🍃 Generated commit b452c31b776247cd678a575dd5fd2562d47c5c93
🌲 Generated branch generated/chore/python-typing-improved
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
javascript 1676
go 1555
php 1480
csharp 1250
java 1101
python 1035
ruby 878
swift 763

Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

noice

@Fluf22 Fluf22 force-pushed the chore/python-typing-improved branch 3 times, most recently from 323d00f to f8c2ea7 Compare September 27, 2024 16:04
@Fluf22 Fluf22 force-pushed the chore/python-typing-improved branch 2 times, most recently from dd8760a to fe33ef6 Compare October 2, 2024 18:29
scripts/formatter.ts Outdated Show resolved Hide resolved
@Fluf22 Fluf22 force-pushed the chore/python-typing-improved branch from d0b497b to 534fca6 Compare October 3, 2024 11:52
@Fluf22 Fluf22 requested a review from millotp October 3, 2024 14:00
Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

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

the more I look at this the more I hate python.

GG for doing this !

@@ -19,20 +19,10 @@ def snippet_for_{{#lambda.snakecase}}{{method}}{{/lambda.snakecase}}{{testIndex}
# Call the API
{{#hasResponse}}response = {{/hasResponse}}client.{{#lambda.snakecase}}{{method}}{{/lambda.snakecase}}({{#parametersWithDataType}}{{> tests/generateParams}}{{/parametersWithDataType}}{{#hasRequestOptions}} request_options={ {{#requestOptions.headers.parameters}}"headers":loads("""{{{.}}}"""),{{/requestOptions.headers.parameters}}{{#requestOptions.queryParameters.parameters}}"query_parameters":loads("""{{{.}}}"""),{{/requestOptions.queryParameters.parameters}} }{{/hasRequestOptions}})

{{#hasResponse}}print(response){{/hasResponse}}

# Skip deserialization
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this was requested by customers, we need both async and sync in the snippets

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is still sync/async snippets, it's above your comment
I removed the call to the _with_http_info variant of the method

tests/output/python/requirements.txt Outdated Show resolved Hide resolved
yarn.lock Outdated Show resolved Hide resolved
@millotp millotp force-pushed the chore/python-typing-improved branch 2 times, most recently from 61f8607 to 1a0d1d0 Compare October 3, 2024 15:50
Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

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

all good !

@Fluf22 Fluf22 merged commit 6b42a26 into main Oct 4, 2024
28 checks passed
@Fluf22 Fluf22 deleted the chore/python-typing-improved branch October 4, 2024 08:21
algolia-bot added a commit that referenced this pull request Oct 4, 2024
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
algolia-bot added a commit to algolia/algoliasearch-client-python that referenced this pull request Oct 4, 2024
algolia/api-clients-automation#3839

Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
algolia-bot added a commit to algolia/algoliasearch-client-swift that referenced this pull request Oct 4, 2024
algolia/api-clients-automation#3839

Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
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.

4 participants