tessl install tessl/pypi-influxdb-client@1.49.0Comprehensive Python client library for InfluxDB 2.x with sync/async APIs for writing, querying, and managing time series data.
Agent Success
Agent success rate when using this tile
82%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.19x
Baseline
Agent success rate without this tile
69%
Build a system that reads sensor data from multiple sources and writes it to a time-series database with appropriate numeric field types to avoid type conflicts.
Different sensors produce numeric values in different formats. Some sensors return signed integers (temperature in Celsius), others return unsigned integers (counts, IDs), and some return floating-point values (pressure in atmospheres). When writing this data to a time-series database, it's important to specify the correct numeric type for each field to prevent schema conflicts and ensure data integrity.
Create a Python module that:
@generates
def write_sensor_data(client, bucket: str, measurement: str, sensor_data: dict, timestamp=None):
"""
Write sensor data to the time-series database with appropriate field types.
Args:
client: Database client instance
bucket: Target bucket name
measurement: Measurement name for the data point
sensor_data: Dictionary containing sensor readings with keys:
- 'temperature': signed integer (Celsius)
- 'counter': unsigned integer
- 'pressure': float (atmospheres)
timestamp: Optional timestamp for the data point (defaults to current time)
Returns:
None
"""
passProvides time-series data writing capabilities with field type customization support.
@satisfied-by