Coder Social home page Coder Social logo

Comments (6)

cpcloud avatar cpcloud commented on June 1, 2024 1

We probably need to see the ibis expression. Column names that look like that should effectively never make it into bigquery.

Can you give a reproducible example that only uses Ibis? We definitely need to see what Ibis APIs you're using to produce this error.

from ibis.

jitingxu1 avatar jitingxu1 commented on June 1, 2024

Rewrite the problem description with an easy example

from ibis.

jitingxu1 avatar jitingxu1 commented on June 1, 2024

Updated the error message*******

400 POST https://bigquery.googleapis.com/upload/bigquery/v2/projects/voltrondata-demo/jobs?uploadType=multipart: Invalid field name "Cast(y, int64)_ef9a46". Fields must contain the allowed characters, and be at most 300 characters long. For allowed characters, please refer to https://cloud.google.com/bigquery/docs/schemas#column_names

seems like Cast(y, int64)_ef9a46 is not a valid name for bigquery, because have letters after number.

from ibis.

gforsyth avatar gforsyth commented on June 1, 2024

are you running against main? That looks like the bigquery issues I fixed yesterday in #9141 and #9149

from ibis.

jitingxu1 avatar jitingxu1 commented on June 1, 2024

oh, no. Let me pull it from main

are you running against main? That looks like the bigquery issues I fixed yesterday in #9141 and #9149

from ibis.

jitingxu1 avatar jitingxu1 commented on June 1, 2024

we convert an intermediate table into a memtable in bis-ml, see link

The intermediate information in the expression tree got lost, unfortunately, the new name "Cast(y, float64)" is not a valid bigquery column name.

I think it is not an ibis issue, we could fix this in ibisml.

Here is the simplified code to reproduce the error:

import ibis
ibis.options.interactive = True

con = ibis.bigquery.connect(project_id="xx", dataset_id="xx")

t = ibis.memtable({
    "x": ["a", "b"],
    "y": ["0", "1"]
})
con.create_table(
    "t", t.to_pyarrow(), overwrite=True
)

t = con.table("t")

base_table = t.drop("y")
target_table = t.y.cast(dt.float64)


y_m = ibis.memtable(target_table.as_table().to_pyarrow())
y_m = y_m.mutate(x=ibis.literal("a"))

base_table.join(y_m, "x")

And the new name "Cast(y, float64)" is not a valid name in bigquery.

ibis.to_sql(y_m)
sql
SELECT
  "t0"."Cast(y, float64)",
  'a' AS "x"
FROM "ibis_pyarrow_memtable_cimh6vdzlvhyxlddji3g6jvugq" AS "t0"

from ibis.

Related Issues (20)

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.