Comments (4)
@JHFVR I have tried to reproduce it , but not able to do that. Please verify it and let me know if i missed anything.
Sample Code:
from google.cloud import bigquery
client = bigquery.Client()
schema = [
bigquery.SchemaField("File_Name", "STRING", mode="REQUIRED"),
bigquery.SchemaField("Age", "INTEGER"),
]
table = bigquery.Table('project_id.dataset.id', schema=schema)
table = client.create_table(table)
print (table.schema)
[SchemaField('File_Name', 'STRING', 'REQUIRED', None, ()),
SchemaField('Age', 'INTEGER', 'NULLABLE', None, ())]
dataset_ref = client.dataset("test_dataset")
job_config = bigquery.LoadJobConfig()
job_config.write_disposition = bigquery.WriteDisposition.WRITE_TRUNCATE
job_config.source_format = bigquery.SourceFormat.PARQUET
load_job = client.load_table_from_uri(uri, dataset_ref.table("id"), job_config=job_config)
load_job.result()
destination_table = client.get_table(dataset_ref.table("id"))
print("Loaded {} schema.".format(destination_table.schema))
Loaded [SchemaField('File_Name', 'STRING', 'REQUIRED', None, ()), SchemaField('Age', '
INTEGER', 'NULLABLE', None, ())] schema.
Also verify Parquet file schema:
import pyarrow.parquet as pq
pq.read_schema(local_file_path_parquet)
Output:
File_Name: string not null
Age: int64
metadata
--------
OrderedDict([(b'ARROW:schema',............)])
from python-bigquery.
@JHFVR Any update on this?
from python-bigquery.
@JHFVR Any progress from your side? I am still not able to reproduce the issue.
from python-bigquery.
@JHFVR Please follow-up / reopen if you can provide more information.
from python-bigquery.
Related Issues (20)
- Support inserting data into BigQuery directly from a Polars DataFrame HOT 4
- BigQuery Python client fails to query JSON field with heterogeneous data types
- Cannot append to REQUIRED field when using `client.load_table_from_file` without providing table schema HOT 7
- Should a rateLimitExceeded have a "429 Too Many Requests" instead of "403 Forbidden"? HOT 1
- snapshot_definition.snapshot_time throws exception
- Add a warning in the type mapping if no conversion function is found
- `table_constraints` has no setter?
- Retry didn't happen
- BUG: `read_pandas` Error: 'values' Attribute Missing in `ChunkedArray` HOT 4
- totalBytesProcessed is not exposed from RowIterator HOT 1
- BUG: `bq_to_arrow_field` in `_pandas_helper.py` always sets `pyarrow.field` to nullable
- [BUG] Undefined symbol in __all__
- RecursionError when pickling Table object
- Should a rateLimitExceeded have a "429 Too Many Requests" instead of "403 Forbidden"? HOT 2
- Cannot append to REPEATED field when using `client.load_table_from_file` with parquet file HOT 1
- ArrayQueryParameter.from_api_repr does not support empty array
- No retry on Impersonation Token Bigquery HOT 2
- support adbc APIs in DB-API package
- Select columns with `extract_table`? HOT 4
- Make `max_stream_count` configurable when using Bigquery Storage API HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-bigquery.