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

Improved example and fixed comments #5721

Closed

Conversation

MeelahMe
Copy link

Closes #

Describe your proposed changes here.

I went with the quick fix for the comments. Shortened the writing and query example. I also gave some more explanation for the example.

@MeelahMe MeelahMe marked this pull request as draft December 23, 2024 22:15
@MeelahMe MeelahMe changed the title Improve example fixed comments WIP: Improve example fixed comments Dec 23, 2024
@MeelahMe MeelahMe changed the title WIP: Improve example fixed comments WIP: Improved example and fixed comments Dec 23, 2024
Copy link
Contributor

@jstirnaman jstirnaman left a comment

Choose a reason for hiding this comment

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

The important parts look great, just a few details and the following--can you:

  • remove the submodules from your branch
  • take the PR out of draft status
  • close your old PR

token=f"DATABASE_TOKEN",
write_client_options=wco) as client:

#### Example: Writing and querying data
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding this description. The list_code_example should only contain a code block, not Markdown content. I think we should move the description inside the python code block as python comments.

table = client.query(
'''SELECT *
FROM home
WHERE time >= now() - INTERVAL '90 days'
ORDER BY time''')
```
This script assumes the client object is correctly configured with your database name, token, and host URL. After running the query, table will contain the queried data formatted as a PyArrow table.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This script assumes the client object is correctly configured with your database name, token, and host URL. After running the query, table will contain the queried data formatted as a PyArrow table.
This script assumes the client object is correctly configured with your database name, token, and host URL. After the script runs, the table variable contains the data formatted as a PyArrow table.

This should also be a comment inside the code block.

- [`influxdb_client_3.Point`](#class-point): a class for constructing a time series data
point
- [`influxdb_client_3.InfluxDBClient3`](#class-influxdbclient3): a class for interacting with InfluxDB.
- [`influxdb_client_3.Point`](#class-point): a class for constructing time a series data
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- [`influxdb_client_3.Point`](#class-point): a class for constructing time a series data
- [`influxdb_client_3.Point`](#class-point): a class for constructing a time series data

- [`influxdb_client_3.InfluxDBClient3`](#class-influxdbclient3): a class for interacting with InfluxDB
- [`influxdb_client_3.Point`](#class-point): a class for constructing a time series data
point
- [`influxdb_client_3.InfluxDBClient3`](#class-influxdbclient3): a class for interacting with InfluxDB.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for catching the punctuation.

Just FYI, we'd typically do the reverse--we don't use periods if all the bullets are phrases (incomplete sentences). If at least one needs a complete sentence, then we'll end them all with periods to be consistent.

I'm not going to nitpick, though, as long as it looks consistent.


# Write data in batches
```python
Copy link
Contributor

Choose a reason for hiding this comment

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

👍


#### Example: Writing and querying data

The following example demonstrates how to write sensor data into influxDB and retrieve data from the last 90 days for analysis.
Copy link
Contributor

Choose a reason for hiding this comment

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

💯

@MeelahMe MeelahMe changed the title WIP: Improved example and fixed comments Improved example and fixed comments Dec 23, 2024
@MeelahMe MeelahMe linked an issue Dec 23, 2024 that may be closed by this pull request
@MeelahMe MeelahMe closed this Dec 23, 2024
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.

Python client library: fix broken list code example formatting
2 participants