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

SchemaError / NotImplementedError: The python type string is not implemented (yet) #1247

Open
orlandombaa opened this issue Oct 21, 2023 · 2 comments
Labels
bug Something isn't working needs triage Awaiting triage by a dask-sql maintainer

Comments

@orlandombaa
Copy link

orlandombaa commented Oct 21, 2023

Hello

I start to use dask- sql but I cant make any simple query, I can just make a total selection with select * from df;. Beside this query I cant do anything else, in every query I get the samme error: SchemaError.

Like the following example:

import pandas as pd 
import dask.dataframe as dd
from dask_sql import Context

# Crear un pandas DF 
test = {"Nombre":["Orlando", "Fernando", "Rosario", "Cuah", "Verónica"],
        "Sexo":["M", "M","F","M","F"], 
        "Edad":[30,40,50,60,56]}

test=pd.DataFrame(data=test)

# Creamos un dask df a partir de un pandas df
test= dd.from_pandas(data=test, npartitions=2)
print("Tipo de objeto:", type(test))
test.head()


#  Crea un contexto para dask-sql
c = Context()

# Registra el DataFrame de Dask en el contexto para poder referenciarlo en las consultas SQL
c.create_table(table_name="test", input_table=test)

result = c.sql("""
    SELECT
        Nombre
    FROM test
""")
result.compute()

Then I get this error: ParsingException: SchemaError(FieldNotFound { field: Column { relation: None, name: "nombre" }, valid_fields: [] })

I get the same error in more complex dataframes that I am using. Can some one help me understand why this happen?

@orlandombaa orlandombaa added bug Something isn't working needs triage Awaiting triage by a dask-sql maintainer labels Oct 21, 2023
@orlandombaa
Copy link
Author

Ahora con el mismo codigo me sale el siguiente error:

NotImplementedError: The python type string is not implemented (yet)

@orlandombaa orlandombaa changed the title SchemaError SchemaError / NotImplementedError: The python type string is not implemented (yet) Oct 21, 2023
@orlandombaa
Copy link
Author

Hello !
I just solve this problem. For some reason which I would love to have some information from you comunity this code can run perfectly if I create my DF with the name of the columns in lowercase. If I create this df in lowercase and query it in lowercase all works perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting triage by a dask-sql maintainer
Projects
None yet
Development

No branches or pull requests

1 participant