Giter VIP home page Giter VIP logo

sql_to_ibis's Issues

Support for ibis-framework>=2.1.1 and SQLAlchemy>=1.4

Kindly please add support for recent ibis-framework which is compatible with recent SQLAlchemy>=1.4.
Without this, I can't use sql-to-ibis with recent SQLAlchemy, because in version 1.4 some of data types were renamed (and probably more breaking changes were introduced).

Example from README.rst does not work

I got the following error when I tried to execute the code as is

Traceback (most recent call last):
  File "/Users/pavel/Projects/sql_to_ibis/mytest.py", line 1, in <module>
    import ibis.pandas.api
ModuleNotFoundError: No module named 'ibis.pandas'

After I adjusted ibis packages

import ibis
import pandas
import sql_to_ibis

df = pandas.DataFrame({"column1": [1, 2, 3], "column2": ["4", "5", "6"]})
ibis_table = ibis.backends.pandas.from_dataframe(
    df, name="my_table", client=ibis.backends.pandas.PandasClient({})
)
sql_to_ibis.register_temp_table(ibis_table, "my_table")
sql_to_ibis.query(
    "select column1, cast(column2 as integer) + 1 as my_col2 from my_table"
).execute()

I got the following error:

Traceback (most recent call last):
  File "~/miniconda3/envs/sql_to_ibis/lib/python3.9/site-packages/lark/lexer.py", line 376, in lex
    for x in l.lex(stream, self.root_lexer.newline_types, self.root_lexer.ignore_types):
  File "~/miniconda3/envs/sql_to_ibis/lib/python3.9/site-packages/lark/lexer.py", line 182, in lex
    raise UnexpectedCharacters(stream, line_ctr.char_pos, line_ctr.line, line_ctr.column, allowed=allowed, state=self.state, token_history=last_token and [last_token])
lark.exceptions.UnexpectedCharacters: No terminal defined for 'e' at line 1 col 36

select column1, cast(column2 as integer) + 1 as my_col2 from my_table
                                   ^

Expecting: {'RPAR'}

Previous tokens: Token(TYPENAME, 'int')

BUG? sql IN operator only works with a list of two values

SELECT * FROM mytable WHERE mycolumn IN ('value1', 'value2') works fine, but if I have more than two values within the parentheses, InvalidQueryException is raised. The typical use of IN should allow for n comparison values. Am I misunderstanding something in composing my query or is there a workaround for this operator to use more than two values? Thanks!

BUG: Extraneous parens raise InvalidQueryException

"SELECT * FROM mytable WHERE column1='x' AND (column2='y' OR column3='z') works but
"SELECT * FROM mytable WHERE (column1='x' AND (column2='y' OR column3='z')) raises InvalidQueryException.

Sure, the outer parens around the where clause are extraneous, but the expression should still evaluate. I'm compiling where clauses from thousands of overlapping geographic features, and it is helpful as a default setting to enclose each sub-clause in parens, even if that means a lone feature ends up wrapped in these extraneous characters.

Happy to provide additional information/clarification if needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.