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

Resolved TODO in crate-exporter.py #704

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Replaced entity with getter (#652)
- Resolved TODO in Dockerfile (#680)
- Resolved TODO at src/reporter/tests/test_timescale_types.py (#667)
- Resolved TODO at timescale-container/crate-exporter.py (#702)

### Bug fixes

Expand Down
16 changes: 4 additions & 12 deletions timescale-container/crate-exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,13 @@ class CrateSql:

@staticmethod
def to_string(x) -> str:
"""
Convert the input into a Crate string.
E.g. input ~~~> 'input'
"""
Comment on lines -72 to -75
Copy link
Member

Choose a reason for hiding this comment

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

why delete the docs?

v = str(x) # TODO consider escaping?
return f"'{v}'"

return f"'{x}'"
Copy link
Member

Choose a reason for hiding this comment

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

how is this going to help? :-)

>>> x = "howzit'!'"
>>> f"'{x}'"
"'howzit'!''"

whereas the single quotes in x should've been escaped: 'howzit\'!\''. Or something similar, can't remember offhand what the escape sequence is for Crate...


@staticmethod
def to_quoted_identifier(x) -> str:
"""
Convert the input into a Crate quoted identifier.
E.g. input ~~~> "input"
"""
Comment on lines -81 to -84
Copy link
Member

Choose a reason for hiding this comment

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

why delete the docs?

v = str(x) # TODO consider escaping?
return f'"{v}"'

return f'"{x}"'
Copy link
Member

Choose a reason for hiding this comment

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

how is this going to help? :-)

>>> x = 'howzit"!"'
>>> f'"{x}"'
'"howzit"!""'

whereas the double quotes in x should've been escaped: "howzit\"!\"". Or something similar, can't remember offhand what the escape sequence is for Crate...



class CrateTableIdentifier:
Expand Down
Loading