Giter Site home page Giter Site logo

Comments (3)

jitendrawbd avatar jitendrawbd commented on May 29, 2024

Using even the simplest of loading doesn't seem to work

def testapi():
    df = pd.DataFrame(
        {
            "my_string": ["a", "b", "c"],
            "my_int64": [1, 2, 3],
            "my_float64": [4.0, 5.0, 6.0],
            "my_bool1": [True, False, True],
            "my_bool2": [False, True, False]
        }
    )
    to_gbq(df, 'test_dataset.test_table', project_id='gcp-cap-dsml-core-dev')

Testing the above with bigquery emulator results in error

GenericGBQException("Reason: {0}".format(ex)) from ex
pandas_gbq.exceptions.GenericGBQException: Reason: 400 POST http://localhost:9050/bigquery/v2/projects/local-project/jobs?prettyPrint=false: unspecified job configuration query

from bigquery-emulator.

ohaibbq avatar ohaibbq commented on May 29, 2024

It looks like the jobs insert handler currently only handles query jobs, import from GCS, and extract to GCS jobs:
https://github.com/goccy/bigquery-emulator/blob/main/server/handler.go#L1372-L1391

to_gbq uses the BigQueryClient.load_table_from_dataframe method which POSTs a CSV / Parquet file to the API.

In our project, we use google_cloud.bigquery.Client.insert_rows to populate tables.

from bigquery-emulator.

jitendrawbd avatar jitendrawbd commented on May 29, 2024

Ah, got it. Any plans to incorporate BigQueryClient.load_table_from_dataframe function in the future? For now, I will look for some workaround

from bigquery-emulator.

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.