Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

SELECT query that starts with a blank line wont work using DataFrameClient #425

@gagath

Description

@gagath

When writing long queries I tend to put split them onto serveral lines. The parenthesis and backslash Python string merge methods will work, but not the multiline string if you dont start with the SELECT keyword on the first line.

Example that works:

result = client.query("""select temperature from temperature 
where time > '2017-03-13 10:40:00.000' 
and time < '2017-03-13 12:30:00.000' 
order by time""")

Example that does not work but should IMO:

result = client.query("""
select temperature from temperature 
where time > '2017-03-13 10:40:00.000' 
and time < '2017-03-13 12:30:00.000' 
order by time""")

Code location: https://github.com/influxdata/influxdb-python/blob/master/influxdb/_dataframe_client.py#L143

Proposed fix: Add a call to Python's str.strip() method on this line.

I can write a pull request if you are ok to merge it (should be one line of code + verifying tests results + maybe adding a new test for this scenario).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy