Thanks to visit codestin.com
Credit goes to github.com

Skip to content

_time is None when setting timezone through DateHelper #454

Closed
@AaronCarton

Description

@AaronCarton

Steps to reproduce:

  1. set timezone as seen in:
    feat: add possibility to specify default timezone for datetimes without tzinfo #238
  2. query something similar as below
  3. returned tables have None as start/stop/time fields
date_utils.date_helper = DateHelper(timezone=tzlocal())
with InfluxDBClient(url=URL, token=TOKEN, org=ORG, timeout=25_000) as client:
   query= f'''import "date"
                   from(bucket: "{BUCKET}")
                      |> range(start: date.truncate(t: now(), unit: 1d), stop: now())
                      |> filter(fn: (r) => r._measurement == "Duiktank")
                      |> aggregateWindow(every: 1h, fn: sum)
                '''
   tables = client.query_api().query(query, org=ORG)

Expected behavior:
Query returns localized time/start/stop

Actual behavior:
Query returns None time/start/stop
image

Specifications:

  • Client Version: 1.29.1
  • InfluxDB Version:
  • Platform: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions