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: add type hints to methods #157

Closed
darwinyip opened this issue Jul 7, 2020 · 5 comments · Fixed by #613
Closed

feat: add type hints to methods #157

darwinyip opened this issue Jul 7, 2020 · 5 comments · Fixed by #613
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. type: docs Improvement to the documentation for an API.

Comments

@darwinyip
Copy link

Having typings in the library would help and saw that there is a PR opened for that. However, the documentation is somewhat lacking.

It is hard to tell what the methods return and are all the parameters while looking at the docs https://googleapis.dev/python/bigquery/latest/generated/google.cloud.bigquery.client.Client.html

For example, in the tutorial: what is the difference between these 2 table objects created?

table = bigquery.Table(table_id, schema=schema)
table = client.create_table(table)  # Make an API request.
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Jul 7, 2020
@meredithslota meredithslota added the type: docs Improvement to the documentation for an API. label Jul 7, 2020
@HemangChothani HemangChothani self-assigned this Jul 8, 2020
@HemangChothani
Copy link
Contributor

@darwinyip Description of the following statements:

 table = bigquery.Table(table_id, schema=schema)   
# This statement creates a table class object locally which you need pass to `create_table` method to create your table 

table = client.create_table(table)
# This statement sent a request to the server to create a table in BigQuery database and return the table object with it's properties and information

Example:
table.created   # it gives the datetime of table creation
table.etag  # gives the Etag of table
table.num_rows  # gives the number of rows in table
table.full_table_id  # full id of table including project and dataset.

@HemangChothani
Copy link
Contributor

@darwinyip Did above explanation helped you?

@darwinyip
Copy link
Author

@HemangChothani Yes it did. Thank you. However main issue I am raising is the lack of documentation around it.

@HemangChothani
Copy link
Contributor

HemangChothani commented Aug 24, 2020

@darwinyip Is you concern related to type hints, types to method params.

@tswast tswast changed the title Documentation on return types feat: add type hints to methods Dec 9, 2020
@HemangChothani
Copy link
Contributor

HemangChothani commented Dec 18, 2020

Should i mention return type of all the public methods of all the classes?

Edit: Should we include pytype nox.py file to check type hints and return type as included in firestore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. type: docs Improvement to the documentation for an API.
Projects
None yet
3 participants