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

Properly quote all identifiers and literals in InfluxDBClient #361

Merged
merged 1 commit into from
Sep 9, 2016

Conversation

saaros
Copy link
Contributor

@saaros saaros commented Aug 15, 2016

Previously InfluxDBClient tried to quote some of the identifiers (database
and usernames, etc), but a number of API calls didn't have any quoting, and
the ones that had quoting didn't account for special characters inside the
identifiers.

Add new quote_ident() and quote_literal() functions to line_protocol.py
and use them consistently in the client.

Previously InfluxDBClient tried to quote some of the identifiers (database
and usernames, etc), but a number of API calls didn't have any quoting, and
the ones that had quoting didn't account for special characters inside the
identifiers.

Add new `quote_ident()` and `quote_literal()` functions to line_protocol.py
and use them consistently in the client.
@wladekb
Copy link

wladekb commented Sep 9, 2016

This PR may help with such obvious issues like this one:

influxdb_client.write_points([{
  'measurement':'t1',
  'fields':{
    'a':'a\\' # HERE: slash at the end of the field value
  }
}])

which apparently ends up with broken line and influxdb returns 400 Bad Request (unbalanced quotes)

Any chance that this could be merged soon?

@aviau aviau merged commit 898c4b6 into influxdata:master Sep 9, 2016
@aviau
Copy link
Collaborator

aviau commented Sep 9, 2016

Thanks!

@virusdefender
Copy link

This PR fixed my issue #365

thanks @saaros

@saaros saaros deleted the quote_ident branch September 12, 2016 07:59
@lwis
Copy link

lwis commented Sep 21, 2016

When will this be released?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants