Skip to content

How to Rename Columns with a Hash (#) Symbol in Ibis with Trino Backend? #7749

Discussion options

You must be logged in to vote

hi @stereoF, I think you can use dictionary unpacking syntax (not sure if that's the proper term for this) to workaround:

df = df.rename(**{"user_id": "#long_id"})

demo w/ the DuckDB backend, should work the same on Trino:

[ins] In [1]: import ibis

[ins] In [2]: ibis.options.interactive = True

[ins] In [3]: t = ibis.examples.penguins.fetch()

[ins] In [4]: t
Out[4]:
┏━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━┓
┃ speciesislandbill_length_mmbill_depth_mmflipper_length_mmbody_mass_gsexyear  ┃
┡━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━┩
│ s…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by stereoF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants