├── .coveragerc ├── .flake8 ├── .github ├── .OwlBot.lock.yaml ├── .OwlBot.yaml ├── CODEOWNERS ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── support_request.md ├── PULL_REQUEST_TEMPLATE.md ├── auto-approve.yml ├── auto-label.yaml ├── blunderbuss.yml ├── header-checker-lint.yml ├── release-please.yml ├── release-trigger.yml ├── snippet-bot.yml ├── sync-repo-settings.yaml └── workflows │ ├── docs.yml │ ├── lint.yml │ ├── mypy.yml │ └── unittest.yml ├── .gitignore ├── .isort.cfg ├── .kokoro ├── build.sh ├── continuous │ ├── common.cfg │ ├── continuous.cfg │ ├── doctest.cfg │ ├── e2e.cfg │ ├── nightly.cfg │ ├── notebook.cfg │ ├── prerelease-deps.cfg │ └── windows.cfg ├── load │ ├── benchmark.cfg │ ├── common.cfg │ ├── load.cfg │ └── notebook.cfg ├── populate-secrets.sh ├── presubmit │ ├── common.cfg │ ├── doctest.cfg │ ├── e2e-gerrit.cfg │ ├── e2e.cfg │ ├── notebook.cfg │ ├── prerelease-deps.cfg │ ├── presubmit-gerrit.cfg │ ├── presubmit.cfg │ └── windows.cfg ├── release-nightly.sh ├── samples │ ├── lint │ │ ├── common.cfg │ │ ├── continuous.cfg │ │ ├── periodic.cfg │ │ └── presubmit.cfg │ ├── python3.10 │ │ ├── common.cfg │ │ ├── continuous.cfg │ │ ├── periodic-head.cfg │ │ ├── periodic.cfg │ │ └── presubmit.cfg │ ├── python3.11 │ │ ├── common.cfg │ │ ├── continuous.cfg │ │ ├── periodic-head.cfg │ │ ├── periodic.cfg │ │ └── presubmit.cfg │ ├── python3.12 │ │ ├── common.cfg │ │ ├── continuous.cfg │ │ ├── periodic-head.cfg │ │ ├── periodic.cfg │ │ └── presubmit.cfg │ ├── python3.13 │ │ ├── common.cfg │ │ ├── continuous.cfg │ │ ├── periodic-head.cfg │ │ ├── periodic.cfg │ │ └── presubmit.cfg │ ├── python3.7 │ │ ├── common.cfg │ │ ├── continuous.cfg │ │ ├── periodic-head.cfg │ │ ├── periodic.cfg │ │ └── presubmit.cfg │ ├── python3.8 │ │ ├── common.cfg │ │ ├── continuous.cfg │ │ ├── periodic-head.cfg │ │ ├── periodic.cfg │ │ └── presubmit.cfg │ └── python3.9 │ │ ├── common.cfg │ │ ├── continuous.cfg │ │ ├── periodic-head.cfg │ │ ├── periodic.cfg │ │ └── presubmit.cfg ├── test-samples-against-head.sh ├── test-samples-impl.sh ├── test-samples.sh ├── trampoline.sh └── trampoline_v2.sh ├── .pre-commit-config.yaml ├── .repo-metadata.json ├── .trampolinerc ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.rst ├── LICENSE ├── MANIFEST.in ├── OWNERS ├── README.rst ├── SECURITY.md ├── bigframes ├── __init__.py ├── _config │ ├── __init__.py │ ├── bigquery_options.py │ ├── compute_options.py │ ├── display_options.py │ ├── experiment_options.py │ └── sampling_options.py ├── _tools │ ├── __init__.py │ └── strings.py ├── bigquery │ ├── __init__.py │ └── _operations │ │ ├── __init__.py │ │ ├── approx_agg.py │ │ ├── array.py │ │ ├── datetime.py │ │ ├── geo.py │ │ ├── json.py │ │ ├── search.py │ │ ├── sql.py │ │ └── struct.py ├── blob │ └── _functions.py ├── clients.py ├── constants.py ├── core │ ├── __init__.py │ ├── array_value.py │ ├── bigframe_node.py │ ├── block_transforms.py │ ├── blocks.py │ ├── compile │ │ ├── __init__.py │ │ ├── aggregate_compiler.py │ │ ├── api.py │ │ ├── compiled.py │ │ ├── compiler.py │ │ ├── concat.py │ │ ├── configs.py │ │ ├── constants.py │ │ ├── default_ordering.py │ │ ├── explode.py │ │ ├── googlesql │ │ │ ├── __init__.py │ │ │ ├── abc.py │ │ │ ├── datatype.py │ │ │ ├── expression.py │ │ │ ├── function.py │ │ │ └── query.py │ │ ├── ibis_types.py │ │ ├── polars │ │ │ ├── __init__.py │ │ │ └── compiler.py │ │ ├── scalar_op_compiler.py │ │ ├── schema_translator.py │ │ └── sqlglot │ │ │ ├── __init__.py │ │ │ ├── compiler.py │ │ │ ├── scalar_compiler.py │ │ │ ├── sqlglot_ir.py │ │ │ └── sqlglot_types.py │ ├── convert.py │ ├── eval.py │ ├── explode.py │ ├── expression.py │ ├── field.py │ ├── global_session.py │ ├── groupby │ │ ├── __init__.py │ │ ├── aggs.py │ │ ├── dataframe_group_by.py │ │ └── series_group_by.py │ ├── guid.py │ ├── identifiers.py │ ├── indexers.py │ ├── indexes │ │ ├── __init__.py │ │ ├── base.py │ │ ├── datetimes.py │ │ └── multi.py │ ├── join_def.py │ ├── local_data.py │ ├── log_adapter.py │ ├── nodes.py │ ├── ordering.py │ ├── pruning.py │ ├── pyarrow_utils.py │ ├── pyformat.py │ ├── reshape │ │ ├── __init__.py │ │ ├── api.py │ │ ├── concat.py │ │ ├── encoding.py │ │ ├── merge.py │ │ └── tile.py │ ├── rewrite │ │ ├── __init__.py │ │ ├── fold_row_count.py │ │ ├── identifiers.py │ │ ├── implicit_align.py │ │ ├── legacy_align.py │ │ ├── order.py │ │ ├── pruning.py │ │ ├── scan_reduction.py │ │ ├── schema_binding.py │ │ ├── slices.py │ │ ├── timedeltas.py │ │ └── windows.py │ ├── scalar.py │ ├── schema.py │ ├── sequences.py │ ├── slices.py │ ├── sql.py │ ├── tools │ │ ├── __init__.py │ │ └── datetimes.py │ ├── tree_properties.py │ ├── utils.py │ ├── validations.py │ ├── window │ │ ├── __init__.py │ │ ├── ordering.py │ │ └── rolling.py │ └── window_spec.py ├── dataframe.py ├── dtypes.py ├── enums.py ├── exceptions.py ├── features.py ├── formatting_helpers.py ├── functions │ ├── __init__.py │ ├── _function_client.py │ ├── _function_session.py │ ├── _utils.py │ ├── function.py │ └── function_template.py ├── geopandas │ ├── __init__.py │ └── geoseries.py ├── ml │ ├── __init__.py │ ├── base.py │ ├── cluster.py │ ├── compose.py │ ├── core.py │ ├── decomposition.py │ ├── ensemble.py │ ├── forecasting.py │ ├── globals.py │ ├── imported.py │ ├── impute.py │ ├── linear_model.py │ ├── llm.py │ ├── loader.py │ ├── metrics │ │ ├── __init__.py │ │ ├── _metrics.py │ │ └── pairwise.py │ ├── model_selection.py │ ├── pipeline.py │ ├── preprocessing.py │ ├── remote.py │ ├── sql.py │ └── utils.py ├── operations │ ├── __init__.py │ ├── _matplotlib │ │ ├── __init__.py │ │ ├── core.py │ │ └── hist.py │ ├── _op_converters.py │ ├── aggregations.py │ ├── ai.py │ ├── array_ops.py │ ├── base.py │ ├── base_ops.py │ ├── blob.py │ ├── blob_ops.py │ ├── bool_ops.py │ ├── comparison_ops.py │ ├── date_ops.py │ ├── datetime_ops.py │ ├── datetimes.py │ ├── distance_ops.py │ ├── frequency_ops.py │ ├── generic_ops.py │ ├── geo_ops.py │ ├── json_ops.py │ ├── lists.py │ ├── numeric_ops.py │ ├── numpy_op_maps.py │ ├── plotting.py │ ├── remote_function_ops.py │ ├── semantics.py │ ├── string_ops.py │ ├── strings.py │ ├── struct_ops.py │ ├── structs.py │ ├── time_ops.py │ ├── timedelta_ops.py │ └── type.py ├── pandas │ ├── __init__.py │ ├── core │ │ ├── __init__.py │ │ ├── api.py │ │ └── tools │ │ │ ├── __init__.py │ │ │ └── timedeltas.py │ └── io │ │ ├── __init__.py │ │ └── api.py ├── py.typed ├── series.py ├── session │ ├── __init__.py │ ├── _io │ │ ├── __init__.py │ │ ├── bigquery │ │ │ ├── __init__.py │ │ │ ├── read_gbq_query.py │ │ │ └── read_gbq_table.py │ │ └── pandas.py │ ├── anonymous_dataset.py │ ├── bigquery_session.py │ ├── bq_caching_executor.py │ ├── clients.py │ ├── dry_runs.py │ ├── environment.py │ ├── executor.py │ ├── loader.py │ ├── local_scan_executor.py │ ├── metrics.py │ ├── planner.py │ ├── read_api_execution.py │ ├── semi_executor.py │ ├── temporary_storage.py │ ├── time.py │ └── validation.py ├── streaming │ ├── __init__.py │ └── dataframe.py ├── testing │ ├── __init__.py │ ├── mocks.py │ └── polars_session.py └── version.py ├── docs ├── Makefile ├── README.rst ├── _static │ └── custom.css ├── _templates │ └── layout.html ├── changelog.md ├── conf.py ├── index.rst ├── reference │ ├── bigframes.bigquery │ │ └── index.rst │ ├── bigframes.geopandas │ │ ├── geoseries.rst │ │ └── index.rst │ ├── bigframes.ml │ │ ├── README.rst │ │ ├── cluster.rst │ │ ├── compose.rst │ │ ├── decomposition.rst │ │ ├── ensemble.rst │ │ ├── forecasting.rst │ │ ├── imported.rst │ │ ├── impute.rst │ │ ├── index.rst │ │ ├── linear_model.rst │ │ ├── llm.rst │ │ ├── metrics.pairwise.rst │ │ ├── metrics.rst │ │ ├── model_selection.rst │ │ ├── pipeline.rst │ │ ├── preprocessing.rst │ │ └── remote.rst │ ├── bigframes.pandas │ │ ├── frame.rst │ │ ├── general_functions.rst │ │ ├── groupby.rst │ │ ├── index.rst │ │ ├── indexers.rst │ │ ├── indexing.rst │ │ ├── options.rst │ │ ├── series.rst │ │ └── window.rst │ ├── bigframes.streaming │ │ ├── dataframe.rst │ │ └── index.rst │ ├── bigframes │ │ ├── enums.rst │ │ ├── exceptions.rst │ │ ├── index.rst │ │ └── options.rst │ └── index.rst ├── supported_pandas_apis.rst ├── supported_pandas_apis │ └── .gitignore └── templates │ └── toc.yml ├── mypy.ini ├── notebooks ├── apps │ └── synthetic_data_generation.ipynb ├── data_types │ ├── array.ipynb │ ├── json.ipynb │ └── struct.ipynb ├── dataframes │ ├── dataframe.ipynb │ ├── index_col_null.ipynb │ ├── integrations.ipynb │ └── pypi.ipynb ├── experimental │ ├── ai_operators.ipynb │ └── semantic_operators.ipynb ├── generative_ai │ ├── bq_dataframes_llm_claude3_museum_art.ipynb │ ├── bq_dataframes_llm_code_generation.ipynb │ ├── bq_dataframes_llm_gemini_2.ipynb │ ├── bq_dataframes_llm_kmeans.ipynb │ ├── bq_dataframes_llm_output_schema.ipynb │ ├── bq_dataframes_llm_vector_search.ipynb │ ├── bq_dataframes_ml_drug_name_generation.ipynb │ ├── large_language_models.ipynb │ └── museum_art.csv ├── geo │ └── geoseries.ipynb ├── getting_started │ ├── bq_dataframes_template.ipynb │ ├── getting_started_bq_dataframes.ipynb │ └── ml_fundamentals_bq_dataframes.ipynb ├── location │ └── regionalized.ipynb ├── ml │ ├── bq_dataframes_ml_cross_validation.ipynb │ ├── bq_dataframes_ml_linear_regression.ipynb │ ├── bq_dataframes_ml_linear_regression_big.ipynb │ ├── easy_linear_regression.ipynb │ └── sklearn_linear_regression.ipynb ├── multimodal │ └── multimodal_dataframe.ipynb ├── remote_functions │ ├── remote_function.ipynb │ ├── remote_function_usecases.ipynb │ └── remote_function_vertex_claude_model.ipynb ├── streaming │ └── streaming_dataframe.ipynb └── visualization │ ├── bq_dataframes_covid_line_graphs.ipynb │ └── tutorial.ipynb ├── noxfile.py ├── owlbot.py ├── pyproject.toml ├── pytest.ini ├── renovate.json ├── samples ├── polars │ ├── create_polars_df_with_to_arrow_test.py │ ├── noxfile.py │ ├── noxfile_config.py │ ├── requirements-test.txt │ └── requirements.txt └── snippets │ ├── __init__.py │ ├── bigquery_modules_test.py │ ├── bqml_getting_started_test.py │ ├── classification_boosted_tree_model_test.py │ ├── clustering_model_test.py │ ├── conftest.py │ ├── create_kmeans_model_test.py │ ├── create_multiple_timeseries_forecasting_model_test.py │ ├── create_single_timeseries_forecasting_model_test.py │ ├── explore_query_result_test.py │ ├── gemini_model_test.py │ ├── imported_onnx_model_test.py │ ├── imported_tensorflow_model_test.py │ ├── limit_single_timeseries_forecasting_model_test.py │ ├── linear_regression_tutorial_test.py │ ├── load_data_from_bigquery_test.py │ ├── load_data_from_biquery_job_test.py │ ├── load_data_from_csv_test.py │ ├── logistic_regression_prediction_test.py │ ├── mf_explicit_model_test.py │ ├── multimodal_test.py │ ├── noxfile.py │ ├── noxfile_config.py │ ├── ordering_mode_partial_test.py │ ├── pandas_methods_test.py │ ├── quickstart.py │ ├── quickstart_test.py │ ├── regression_model_test.py │ ├── remote_function.py │ ├── remote_function_test.py │ ├── requirements-test.txt │ ├── requirements.txt │ ├── set_options_test.py │ ├── udf.py │ └── udf_test.py ├── scratch └── .gitignore ├── scripts ├── __init__.py ├── create_gcs.py ├── create_load_test_tables.py ├── create_test_model_vertex.py ├── data │ ├── images │ │ ├── img0.jpg │ │ └── img1.jpg │ └── images_exif │ │ └── test_image_exif.jpg ├── decrypt-secrets.sh ├── dev-utils │ └── tpcds_upload_helper.py ├── get_documentation_coverage.py ├── manage_cloud_functions.py ├── notebooks_fill_params.py ├── notebooks_restore_from_backup.py ├── publish_api_coverage.py ├── readme-gen │ ├── readme_gen.py │ └── templates │ │ ├── README.tmpl.rst │ │ ├── auth.tmpl.rst │ │ ├── auth_api_key.tmpl.rst │ │ ├── install_deps.tmpl.rst │ │ └── install_portaudio.tmpl.rst ├── run_and_publish_benchmark.py ├── setup-project-for-testing.sh ├── test_publish_api_coverage.py ├── tpch_result_verify.py ├── upload_to_google_drive.py └── windows │ ├── build.bat │ └── test.bat ├── setup.cfg ├── setup.py ├── testing ├── .gitignore ├── constraints-3.10.txt ├── constraints-3.11.txt ├── constraints-3.12.txt ├── constraints-3.13.txt ├── constraints-3.14.txt ├── constraints-3.15.txt └── constraints-3.9.txt ├── tests ├── __init__.py ├── benchmark │ ├── README.md │ ├── __init__.py │ ├── db_benchmark │ │ ├── groupby │ │ │ ├── config.jsonl │ │ │ ├── q1.py │ │ │ ├── q10.py │ │ │ ├── q2.py │ │ │ ├── q3.py │ │ │ ├── q4.py │ │ │ ├── q5.py │ │ │ ├── q6.py │ │ │ ├── q7.py │ │ │ └── q8.py │ │ ├── join │ │ │ ├── config.jsonl │ │ │ ├── q1.py │ │ │ ├── q2.py │ │ │ ├── q3.py │ │ │ ├── q4.py │ │ │ └── q5.py │ │ └── sort │ │ │ ├── config.jsonl │ │ │ └── q1.py │ ├── tpch │ │ ├── config.jsonl │ │ ├── q1.py │ │ ├── q10.py │ │ ├── q11.py │ │ ├── q12.py │ │ ├── q13.py │ │ ├── q14.py │ │ ├── q15.py │ │ ├── q16.py │ │ ├── q17.py │ │ ├── q18.py │ │ ├── q19.py │ │ ├── q2.py │ │ ├── q20.py │ │ ├── q21.py │ │ ├── q22.py │ │ ├── q3.py │ │ ├── q4.py │ │ ├── q5.py │ │ ├── q6.py │ │ ├── q7.py │ │ ├── q8.py │ │ └── q9.py │ └── utils.py ├── data │ ├── hockey_players.json │ ├── hockey_players.jsonl │ ├── json.jsonl │ ├── json_schema.json │ ├── matrix_2by3.json │ ├── matrix_2by3.jsonl │ ├── matrix_3by4.json │ ├── matrix_3by4.jsonl │ ├── nested.jsonl │ ├── nested_schema.json │ ├── nested_structs.jsonl │ ├── nested_structs_schema.json │ ├── penguins.jsonl │ ├── penguins_schema.json │ ├── people.csv │ ├── ratings.jsonl │ ├── ratings_schema.json │ ├── repeated.jsonl │ ├── repeated_schema.json │ ├── scalars.jsonl │ ├── scalars_schema.json │ ├── time_series.jsonl │ ├── time_series_schema.json │ ├── urban_areas.jsonl │ └── urban_areas_schema.json ├── system │ ├── __init__.py │ ├── conftest.py │ ├── large │ │ ├── __init__.py │ │ ├── blob │ │ │ └── test_function.py │ │ ├── functions │ │ │ ├── __init__.py │ │ │ ├── test_managed_function.py │ │ │ └── test_remote_function.py │ │ ├── ml │ │ │ ├── test_cluster.py │ │ │ ├── test_compose.py │ │ │ ├── test_core.py │ │ │ ├── test_decomposition.py │ │ │ ├── test_ensemble.py │ │ │ ├── test_forecasting.py │ │ │ ├── test_linear_model.py │ │ │ ├── test_model_selection.py │ │ │ └── test_pipeline.py │ │ ├── operations │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_ai.py │ │ │ └── test_semantics.py │ │ ├── streaming │ │ │ ├── test_bigtable.py │ │ │ └── test_pubsub.py │ │ ├── test_dataframe.py │ │ ├── test_dataframe_io.py │ │ ├── test_location.py │ │ └── test_session.py │ ├── load │ │ ├── conftest.py │ │ ├── test_large_tables.py │ │ └── test_llm.py │ ├── small │ │ ├── __init__.py │ │ ├── bigquery │ │ │ ├── __init__.py │ │ │ ├── test_approx_agg.py │ │ │ ├── test_array.py │ │ │ ├── test_datetime.py │ │ │ ├── test_geo.py │ │ │ ├── test_json.py │ │ │ ├── test_sql.py │ │ │ ├── test_struct.py │ │ │ └── test_vector_search.py │ │ ├── blob │ │ │ ├── test_io.py │ │ │ ├── test_properties.py │ │ │ └── test_urls.py │ │ ├── core │ │ │ ├── __init__.py │ │ │ ├── indexes │ │ │ │ ├── __init__.py │ │ │ │ ├── test_base.py │ │ │ │ └── test_datetimes.py │ │ │ ├── test_convert.py │ │ │ └── test_indexers.py │ │ ├── functions │ │ │ ├── __init__.py │ │ │ └── test_remote_function.py │ │ ├── geopandas │ │ │ └── test_geoseries.py │ │ ├── ml │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── test_cluster.py │ │ │ ├── test_core.py │ │ │ ├── test_decomposition.py │ │ │ ├── test_ensemble.py │ │ │ ├── test_forecasting.py │ │ │ ├── test_imported.py │ │ │ ├── test_impute.py │ │ │ ├── test_linear_model.py │ │ │ ├── test_llm.py │ │ │ ├── test_metrics.py │ │ │ ├── test_metrics_pairwise.py │ │ │ ├── test_model_selection.py │ │ │ ├── test_multimodal_llm.py │ │ │ ├── test_preprocessing.py │ │ │ ├── test_register.py │ │ │ ├── test_remote.py │ │ │ └── test_utils.py │ │ ├── operations │ │ │ ├── __init__.py │ │ │ ├── test_ai.py │ │ │ ├── test_dates.py │ │ │ ├── test_datetimes.py │ │ │ ├── test_lists.py │ │ │ ├── test_plotting.py │ │ │ ├── test_semantics.py │ │ │ ├── test_strings.py │ │ │ ├── test_struct.py │ │ │ └── test_timedeltas.py │ │ ├── regression │ │ │ └── test_issue355_merge_after_filter.py │ │ ├── session │ │ │ ├── __init__.py │ │ │ └── test_read_gbq_colab.py │ │ ├── test_bq_sessions.py │ │ ├── test_dataframe.py │ │ ├── test_dataframe_io.py │ │ ├── test_encryption.py │ │ ├── test_groupby.py │ │ ├── test_index.py │ │ ├── test_index_io.py │ │ ├── test_ipython.py │ │ ├── test_large_local_data.py │ │ ├── test_multiindex.py │ │ ├── test_null_index.py │ │ ├── test_numpy.py │ │ ├── test_pandas.py │ │ ├── test_pandas_options.py │ │ ├── test_progress_bar.py │ │ ├── test_scalar.py │ │ ├── test_series.py │ │ ├── test_series_io.py │ │ ├── test_session.py │ │ ├── test_unordered.py │ │ └── test_window.py │ └── utils.py └── unit │ ├── __init__.py │ ├── _config │ ├── __init__.py │ ├── test_bigquery_options.py │ ├── test_compute_options.py │ ├── test_experiment_options.py │ └── test_threaded_options.py │ ├── _tools │ ├── __init__.py │ └── test_strings.py │ ├── bigquery │ ├── __init__.py │ └── test_json.py │ ├── core │ ├── __init__.py │ ├── compile │ │ ├── __init__.py │ │ ├── googlesql │ │ │ ├── __init__.py │ │ │ ├── test_expression.py │ │ │ ├── test_function.py │ │ │ └── test_query.py │ │ └── sqlglot │ │ │ ├── __init__.py │ │ │ ├── compiler_session.py │ │ │ ├── conftest.py │ │ │ ├── snapshots │ │ │ ├── test_compile_projection │ │ │ │ └── test_compile_projection │ │ │ │ │ └── out.sql │ │ │ └── test_compile_readlocal │ │ │ │ ├── test_compile_readlocal │ │ │ │ └── out.sql │ │ │ │ ├── test_compile_readlocal_w_json_df │ │ │ │ └── out.sql │ │ │ │ ├── test_compile_readlocal_w_lists_df │ │ │ │ └── out.sql │ │ │ │ ├── test_compile_readlocal_w_nested_structs_df │ │ │ │ └── out.sql │ │ │ │ └── test_compile_readlocal_w_structs_df │ │ │ │ └── out.sql │ │ │ ├── test_compile_projection.py │ │ │ ├── test_compile_readlocal.py │ │ │ └── test_sqlglot_types.py │ ├── test_bf_utils.py │ ├── test_blocks.py │ ├── test_dtypes.py │ ├── test_expression.py │ ├── test_indexes.py │ ├── test_log_adapter.py │ ├── test_pyarrow_utils.py │ ├── test_pyformat.py │ ├── test_rewrite.py │ ├── test_slices.py │ ├── test_sql.py │ ├── test_windowspec.py │ └── tools │ │ ├── __init__.py │ │ └── test_datetimes.py │ ├── functions │ ├── __init__.py │ ├── test_function_template.py │ ├── test_remote_function.py │ └── test_remote_function_utils.py │ ├── ml │ ├── __init__.py │ ├── test_api_primitives.py │ ├── test_compose.py │ ├── test_forecasting.py │ ├── test_golden_sql.py │ ├── test_matrix_factorization.py │ ├── test_pipeline.py │ └── test_sql.py │ ├── operations │ └── __init__.py │ ├── session │ ├── __init__.py │ ├── test_clients.py │ ├── test_io_bigquery.py │ ├── test_io_pandas.py │ ├── test_local_scan_executor.py │ ├── test_read_gbq_colab.py │ ├── test_read_gbq_query.py │ ├── test_read_gbq_table.py │ ├── test_session.py │ └── test_time.py │ ├── test_clients.py │ ├── test_constants.py │ ├── test_daemon.py │ ├── test_dataframe.py │ ├── test_dataframe_io.py │ ├── test_features.py │ ├── test_formatting_helpers.py │ ├── test_index.py │ ├── test_local_data.py │ ├── test_local_engine.py │ ├── test_notebook.py │ ├── test_pandas.py │ ├── test_planner.py │ ├── test_sequences.py │ ├── test_series.py │ └── test_series_io.py └── third_party ├── __init__.py └── bigframes_vendored ├── __init__.py ├── constants.py ├── cpython ├── LICENSE ├── __init__.py └── _pprint.py ├── db_benchmark ├── LICENSE ├── METADATA ├── README.md ├── __init__.py ├── groupby_queries.py ├── join_queries.py └── sort_queries.py ├── geopandas ├── LICENSE.txt └── geoseries.py ├── google_cloud_bigquery ├── LICENSE ├── __init__.py ├── _pandas_helpers.py └── tests │ ├── __init__.py │ └── unit │ ├── __init__.py │ └── test_pandas_helpers.py ├── ibis ├── LICENSE.txt ├── README.md ├── __init__.py ├── backends │ ├── __init__.py │ ├── bigquery │ │ ├── __init__.py │ │ ├── backend.py │ │ ├── client.py │ │ ├── converter.py │ │ ├── datatypes.py │ │ └── udf │ │ │ ├── __init__.py │ │ │ ├── core.py │ │ │ ├── find.py │ │ │ └── rewrite.py │ └── sql │ │ ├── __init__.py │ │ ├── compilers │ │ ├── __init__.py │ │ ├── base.py │ │ └── bigquery │ │ │ └── __init__.py │ │ ├── datatypes.py │ │ └── rewrites.py ├── common │ ├── __init__.py │ ├── annotations.py │ ├── bases.py │ ├── caching.py │ ├── collections.py │ ├── deferred.py │ ├── dispatch.py │ ├── egraph.py │ ├── exceptions.py │ ├── graph.py │ ├── grounds.py │ ├── numeric.py │ ├── patterns.py │ ├── selectors.py │ ├── temporal.py │ └── typing.py ├── config.py ├── expr │ ├── __init__.py │ ├── api.py │ ├── builders.py │ ├── datashape.py │ ├── datatypes │ │ ├── __init__.py │ │ ├── cast.py │ │ ├── core.py │ │ └── value.py │ ├── decompile.py │ ├── format.py │ ├── operations │ │ ├── __init__.py │ │ ├── analytic.py │ │ ├── arrays.py │ │ ├── core.py │ │ ├── generic.py │ │ ├── geospatial.py │ │ ├── histograms.py │ │ ├── json.py │ │ ├── logical.py │ │ ├── maps.py │ │ ├── numeric.py │ │ ├── reductions.py │ │ ├── relations.py │ │ ├── sortkeys.py │ │ ├── strings.py │ │ ├── structs.py │ │ ├── subqueries.py │ │ ├── temporal.py │ │ ├── udf.py │ │ └── window.py │ ├── rewrites.py │ ├── rules.py │ ├── schema.py │ ├── sql.py │ ├── types │ │ ├── __init__.py │ │ ├── arrays.py │ │ ├── binary.py │ │ ├── core.py │ │ ├── dataframe_interchange.py │ │ ├── generic.py │ │ ├── geospatial.py │ │ ├── groupby.py │ │ ├── joins.py │ │ ├── json.py │ │ ├── logical.py │ │ ├── maps.py │ │ ├── numeric.py │ │ ├── pretty.py │ │ ├── relations.py │ │ ├── strings.py │ │ ├── structs.py │ │ ├── temporal.py │ │ ├── temporal_windows.py │ │ ├── typing.py │ │ └── uuid.py │ └── visualize.py ├── formats │ ├── __init__.py │ ├── numpy.py │ ├── pandas.py │ ├── polars.py │ └── pyarrow.py ├── selectors.py └── util.py ├── pandas ├── AUTHORS.md ├── LICENSE ├── README.md ├── __init__.py ├── _config │ └── config.py ├── core │ ├── arrays │ │ ├── __init__.py │ │ ├── arrow │ │ │ ├── __init__.py │ │ │ └── accessors.py │ │ └── datetimelike.py │ ├── common.py │ ├── computation │ │ ├── align.py │ │ ├── common.py │ │ ├── engines.py │ │ ├── eval.py │ │ ├── expr.py │ │ ├── ops.py │ │ ├── parsing.py │ │ └── scope.py │ ├── config_init.py │ ├── dtypes │ │ └── inference.py │ ├── frame.py │ ├── generic.py │ ├── groupby │ │ └── __init__.py │ ├── indexes │ │ ├── __init__.py │ │ ├── accessor.py │ │ ├── base.py │ │ ├── datetimes.py │ │ └── multi.py │ ├── indexing.py │ ├── reshape │ │ ├── __init__.py │ │ ├── concat.py │ │ ├── encoding.py │ │ ├── merge.py │ │ └── tile.py │ ├── series.py │ ├── strings │ │ └── accessor.py │ ├── tools │ │ ├── __init__.py │ │ ├── datetimes.py │ │ └── timedeltas.py │ └── window │ │ ├── __init__.py │ │ └── rolling.py ├── io │ ├── __init__.py │ ├── common.py │ ├── gbq.py │ ├── parquet.py │ ├── parsers │ │ ├── __init__.py │ │ └── readers.py │ └── pickle.py ├── pandas │ └── _typing.py ├── plotting │ └── _core.py └── util │ ├── _exceptions.py │ └── _validators.py ├── py.typed ├── sklearn ├── COPYING ├── __init__.py ├── base.py ├── cluster │ └── _kmeans.py ├── compose │ └── _column_transformer.py ├── decomposition │ ├── _mf.py │ └── _pca.py ├── ensemble │ ├── __init__.py │ └── _forest.py ├── impute │ └── _base.py ├── linear_model │ ├── _base.py │ └── _logistic.py ├── metrics │ ├── _classification.py │ ├── _ranking.py │ ├── _regression.py │ └── pairwise.py ├── model_selection │ ├── _split.py │ └── _validation.py ├── pipeline.py └── preprocessing │ ├── _data.py │ ├── _discretization.py │ ├── _encoder.py │ ├── _label.py │ └── _polynomial.py ├── tpch ├── LICENSE ├── METADATA ├── README.md ├── TPC-EULA.txt ├── __init__.py ├── queries │ ├── __init__.py │ ├── q1.py │ ├── q10.py │ ├── q11.py │ ├── q12.py │ ├── q13.py │ ├── q14.py │ ├── q15.py │ ├── q16.py │ ├── q17.py │ ├── q18.py │ ├── q19.py │ ├── q2.py │ ├── q20.py │ ├── q21.py │ ├── q22.py │ ├── q3.py │ ├── q4.py │ ├── q5.py │ ├── q6.py │ ├── q7.py │ ├── q8.py │ └── q9.py └── sql_queries │ ├── q1.sql │ ├── q10.sql │ ├── q11.sql │ ├── q12.sql │ ├── q13.sql │ ├── q14.sql │ ├── q15.sql │ ├── q16.sql │ ├── q17.sql │ ├── q18.sql │ ├── q19.sql │ ├── q2.sql │ ├── q20.sql │ ├── q21.sql │ ├── q22.sql │ ├── q3.sql │ ├── q4.sql │ ├── q5.sql │ ├── q6.sql │ ├── q7.sql │ ├── q8.sql │ └── q9.sql ├── version.py └── xgboost ├── LICENSE ├── __init__.py └── sklearn.py /.coveragerc: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright 2024 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Generated by synthtool. DO NOT EDIT! 18 | [run] 19 | branch = True 20 | omit = 21 | google/__init__.py 22 | google/cloud/__init__.py 23 | 24 | [report] 25 | fail_under = 35 26 | show_missing = True 27 | exclude_lines = 28 | # Re-enable the standard pragma 29 | pragma: NO COVER 30 | # Ignore debug-only repr 31 | def __repr__ 32 | # Ignore abstract methods 33 | raise NotImplementedError 34 | omit = 35 | */gapic/*.py 36 | */proto/*.py 37 | */site-packages/*.py 38 | google/cloud/__init__.py 39 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright 2024 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Generated by synthtool. DO NOT EDIT! 18 | [flake8] 19 | ignore = E203, E231, E266, E501, W503 20 | exclude = 21 | # Exclude generated code. 22 | **/proto/** 23 | **/gapic/** 24 | **/services/** 25 | **/types/** 26 | *_pb2.py 27 | 28 | # Standard linting exemptions. 29 | **/.nox/** 30 | __pycache__, 31 | .git, 32 | *.pyc, 33 | conf.py 34 | -------------------------------------------------------------------------------- /.github/.OwlBot.lock.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | docker: 15 | image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest 16 | digest: sha256:a7aef70df5f13313ddc027409fc8f3151422ec2a57ac8730fce8fa75c060d5bb 17 | # created: 2025-04-10T17:00:10.042601326Z 18 | -------------------------------------------------------------------------------- /.github/.OwlBot.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | docker: 16 | image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest 17 | 18 | begin-after-commit-hash: 92006bb3cdc84677aa93c7f5235424ec2b157146 19 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Code owners file. 2 | # This file controls who is tagged for review for any given pull request. 3 | # 4 | # For syntax help see: 5 | # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax 6 | # Note: This file is autogenerated. To make changes to the codeowner team, please update .repo-metadata.json. 7 | 8 | # @googleapis/yoshi-python @googleapis/api-bigquery-dataframe are the default owners for changes in this repo 9 | * @googleapis/yoshi-python @googleapis/api-bigquery-dataframe 10 | 11 | # @googleapis/python-samples-reviewers @googleapis/api-bigquery-dataframe are the default owners for samples changes 12 | /samples/ @googleapis/python-samples-reviewers @googleapis/api-bigquery-dataframe 13 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution; 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | 25 | ## Community Guidelines 26 | 27 | This project follows [Google's Open Source Community 28 | Guidelines](https://opensource.google.com/conduct/). 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this library 4 | 5 | --- 6 | 7 | Thanks for stopping by to let us know something could be better! 8 | 9 | **PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. 10 | 11 | **Is your feature request related to a problem? Please describe.** 12 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | **Additional context** 18 | Add any other context or screenshots about the feature request here. 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/support_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Support request 3 | about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. 4 | 5 | --- 6 | 7 | **PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. 8 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: 2 | - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea 3 | - [ ] Ensure the tests and linter pass 4 | - [ ] Code coverage does not decrease (if any source code was changed) 5 | - [ ] Appropriate docs were updated (if necessary) 6 | 7 | Fixes # 🦕 8 | -------------------------------------------------------------------------------- /.github/auto-approve.yml: -------------------------------------------------------------------------------- 1 | # https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve 2 | processes: 3 | - "OwlBotTemplateChanges" 4 | -------------------------------------------------------------------------------- /.github/auto-label.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | requestsize: 15 | enabled: true 16 | 17 | path: 18 | pullrequest: true 19 | paths: 20 | samples: "samples" 21 | -------------------------------------------------------------------------------- /.github/blunderbuss.yml: -------------------------------------------------------------------------------- 1 | # Blunderbuss config 2 | # 3 | # This file controls who is assigned for pull requests and issues. 4 | # Note: This file is autogenerated. To make changes to the assignee 5 | # team, please update `codeowner_team` in `.repo-metadata.json`. 6 | assign_issues: 7 | - googleapis/api-bigquery-dataframe 8 | 9 | assign_issues_by: 10 | - labels: 11 | - "samples" 12 | to: 13 | - googleapis/python-samples-reviewers 14 | - googleapis/api-bigquery-dataframe 15 | 16 | assign_prs: 17 | - googleapis/api-bigquery-dataframe 18 | -------------------------------------------------------------------------------- /.github/header-checker-lint.yml: -------------------------------------------------------------------------------- 1 | {"allowedCopyrightHolders": ["Google LLC"], 2 | "allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"], 3 | "ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"], 4 | "sourceFileExtensions": [ 5 | "ts", 6 | "js", 7 | "java", 8 | "sh", 9 | "Dockerfile", 10 | "yaml", 11 | "py", 12 | "html", 13 | "txt" 14 | ] 15 | } -------------------------------------------------------------------------------- /.github/release-please.yml: -------------------------------------------------------------------------------- 1 | releaseType: python 2 | handleGHRelease: true 3 | extraFiles: 4 | - bigframes/version.py 5 | - third_party/bigframes_vendored/version.py 6 | 7 | branches: 8 | - branch: v1 9 | handleGHRelease: true 10 | releaseType: python 11 | -------------------------------------------------------------------------------- /.github/release-trigger.yml: -------------------------------------------------------------------------------- 1 | enabled: true 2 | multiScmName: python-bigquery-dataframes 3 | -------------------------------------------------------------------------------- /.github/snippet-bot.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/.github/snippet-bot.yml -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: 3 | branches: 4 | - main 5 | name: docs 6 | jobs: 7 | docs: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v4 12 | - name: Setup Python 13 | uses: actions/setup-python@v5 14 | with: 15 | python-version: "3.10" 16 | - name: Install nox 17 | run: | 18 | python -m pip install --upgrade setuptools pip wheel 19 | python -m pip install nox 20 | - name: Run docs 21 | run: | 22 | nox -s docs 23 | docfx: 24 | runs-on: ubuntu-latest 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@v4 28 | - name: Setup Python 29 | uses: actions/setup-python@v5 30 | with: 31 | python-version: "3.10" 32 | - name: Install nox 33 | run: | 34 | python -m pip install --upgrade setuptools pip wheel 35 | python -m pip install nox 36 | - name: Run docfx 37 | run: | 38 | nox -s docfx 39 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: 3 | branches: 4 | - main 5 | name: lint 6 | jobs: 7 | lint: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v4 12 | - name: Setup Python 13 | uses: actions/setup-python@v5 14 | with: 15 | python-version: "3.10" 16 | - name: Install nox 17 | run: | 18 | python -m pip install --upgrade setuptools pip wheel 19 | python -m pip install nox 20 | - name: Run lint 21 | run: | 22 | nox -s lint 23 | - name: Run lint_setup_py 24 | run: | 25 | nox -s lint_setup_py 26 | -------------------------------------------------------------------------------- /.github/workflows/mypy.yml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: 3 | branches: 4 | - main 5 | name: mypy 6 | jobs: 7 | mypy: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - name: Checkout 11 | uses: actions/checkout@v4 12 | - name: Setup Python 13 | uses: actions/setup-python@v5 14 | with: 15 | python-version: "3.10" 16 | - name: Install nox 17 | run: | 18 | python -m pip install --upgrade setuptools pip wheel 19 | python -m pip install nox 20 | - name: Run mypy 21 | run: | 22 | nox -s mypy 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[cod] 2 | *.sw[op] 3 | 4 | # C extensions 5 | *.so 6 | 7 | # Packages 8 | *.egg 9 | *.egg-info 10 | dist 11 | build 12 | eggs 13 | .eggs 14 | parts 15 | bin 16 | var 17 | sdist 18 | develop-eggs 19 | .installed.cfg 20 | lib 21 | lib64 22 | __pycache__ 23 | 24 | # Installer logs 25 | pip-log.txt 26 | 27 | # Unit test / coverage reports 28 | .coverage 29 | .nox 30 | .cache 31 | .pytest_cache 32 | 33 | 34 | # Mac 35 | .DS_Store 36 | 37 | # JetBrains 38 | .idea 39 | 40 | # VS Code 41 | .vscode 42 | 43 | # emacs 44 | *~ 45 | 46 | # Built documentation 47 | docs/_build 48 | bigquery/docs/generated 49 | docs.metadata 50 | 51 | # Virtual environment 52 | env/ 53 | venv/ 54 | 55 | # Test logs 56 | coverage.xml 57 | *sponge_log.xml 58 | 59 | # System test environment variables. 60 | system_tests/local_test_setup 61 | 62 | # Make sure a generated file isn't accidentally committed. 63 | pylintrc 64 | pylintrc.test 65 | -------------------------------------------------------------------------------- /.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | profile=black 3 | force_sort_within_sections=True 4 | lexicographical=True 5 | single_line_exclusions=('typing',) 6 | order_by_type=False 7 | group_by_package=True 8 | -------------------------------------------------------------------------------- /.kokoro/continuous/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | build_file: "python-bigquery-dataframes/.kokoro/build.sh" 11 | -------------------------------------------------------------------------------- /.kokoro/continuous/continuous.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto -------------------------------------------------------------------------------- /.kokoro/continuous/doctest.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "doctest cleanup" 7 | } 8 | 9 | env_vars: { 10 | key: "GOOGLE_CLOUD_PROJECT" 11 | value: "bigframes-testing" 12 | } 13 | -------------------------------------------------------------------------------- /.kokoro/continuous/e2e.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "e2e unit_prerelease system_prerelease system_noextras" 7 | } 8 | 9 | env_vars: { 10 | key: "GOOGLE_CLOUD_PROJECT" 11 | value: "bigframes-load-testing" 12 | } 13 | 14 | env_vars: { 15 | key: "BIGFRAMES_TEST_MODEL_VERTEX_ENDPOINT" 16 | value: "https://us-central1-aiplatform.googleapis.com/v1/projects/272725758477/locations/us-central1/endpoints/590545496255234048" 17 | } 18 | -------------------------------------------------------------------------------- /.kokoro/continuous/nightly.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | build_file: "python-bigquery-dataframes/.kokoro/release-nightly.sh" 4 | -------------------------------------------------------------------------------- /.kokoro/continuous/notebook.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "notebook" 7 | } 8 | 9 | env_vars: { 10 | key: "GOOGLE_CLOUD_PROJECT" 11 | value: "bigframes-testing" 12 | } 13 | -------------------------------------------------------------------------------- /.kokoro/continuous/prerelease-deps.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "prerelease_deps" 7 | } 8 | -------------------------------------------------------------------------------- /.kokoro/continuous/windows.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | build_file: "python-bigquery-dataframes/scripts/windows/build.bat" 4 | -------------------------------------------------------------------------------- /.kokoro/load/benchmark.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "benchmark" 7 | } 8 | 9 | env_vars: { 10 | key: "BENCHMARK_AND_PUBLISH" 11 | value: "true" 12 | } 13 | 14 | env_vars: { 15 | key: "GOOGLE_CLOUD_PROJECT" 16 | value: "bigframes-benchmarking" 17 | } 18 | 19 | env_vars: { 20 | key: "BIGFRAMES_TEST_MODEL_VERTEX_ENDPOINT" 21 | value: "https://us-central1-aiplatform.googleapis.com/v1/projects/272725758477/locations/us-central1/endpoints/590545496255234048" 22 | } 23 | -------------------------------------------------------------------------------- /.kokoro/load/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | build_file: "python-bigquery-dataframes/.kokoro/build.sh" 11 | timeout_mins: 720 12 | -------------------------------------------------------------------------------- /.kokoro/load/load.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "load" 7 | } 8 | 9 | env_vars: { 10 | key: "GOOGLE_CLOUD_PROJECT" 11 | value: "bigframes-load-testing" 12 | } 13 | 14 | env_vars: { 15 | key: "BIGFRAMES_TEST_MODEL_VERTEX_ENDPOINT" 16 | value: "https://us-central1-aiplatform.googleapis.com/v1/projects/272725758477/locations/us-central1/endpoints/590545496255234048" 17 | } 18 | -------------------------------------------------------------------------------- /.kokoro/load/notebook.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "notebook" 7 | } 8 | 9 | env_vars: { 10 | key: "BENCHMARK_AND_PUBLISH" 11 | value: "true" 12 | } 13 | 14 | env_vars: { 15 | key: "GOOGLE_CLOUD_PROJECT" 16 | value: "bigframes-testing" 17 | } 18 | -------------------------------------------------------------------------------- /.kokoro/presubmit/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | build_file: "python-bigquery-dataframes/.kokoro/build.sh" 11 | -------------------------------------------------------------------------------- /.kokoro/presubmit/doctest.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "doctest cleanup" 7 | } 8 | 9 | env_vars: { 10 | key: "GOOGLE_CLOUD_PROJECT" 11 | value: "bigframes-testing" 12 | } 13 | -------------------------------------------------------------------------------- /.kokoro/presubmit/e2e-gerrit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "system_noextras e2e notebook" 7 | } 8 | -------------------------------------------------------------------------------- /.kokoro/presubmit/e2e.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "e2e unit_prerelease system_prerelease system_noextras" 7 | } 8 | 9 | env_vars: { 10 | key: "GOOGLE_CLOUD_PROJECT" 11 | value: "bigframes-load-testing" 12 | } 13 | 14 | env_vars: { 15 | key: "BIGFRAMES_TEST_MODEL_VERTEX_ENDPOINT" 16 | value: "https://us-central1-aiplatform.googleapis.com/v1/projects/272725758477/locations/us-central1/endpoints/590545496255234048" 17 | } 18 | -------------------------------------------------------------------------------- /.kokoro/presubmit/notebook.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "notebook" 7 | } 8 | 9 | env_vars: { 10 | key: "GOOGLE_CLOUD_PROJECT" 11 | value: "bigframes-testing" 12 | } 13 | -------------------------------------------------------------------------------- /.kokoro/presubmit/prerelease-deps.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Only run this nox session. 4 | env_vars: { 5 | key: "NOX_SESSION" 6 | value: "prerelease_deps" 7 | } 8 | -------------------------------------------------------------------------------- /.kokoro/presubmit/presubmit-gerrit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | -------------------------------------------------------------------------------- /.kokoro/presubmit/presubmit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto -------------------------------------------------------------------------------- /.kokoro/presubmit/windows.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | build_file: "python-bigquery-dataframes/scripts/windows/build.bat" 4 | -------------------------------------------------------------------------------- /.kokoro/samples/lint/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | # Specify which tests to run 11 | env_vars: { 12 | key: "RUN_TESTS_SESSION" 13 | value: "lint" 14 | } 15 | 16 | env_vars: { 17 | key: "TRAMPOLINE_BUILD_FILE" 18 | value: "github/python-bigquery-dataframes/.kokoro/test-samples.sh" 19 | } 20 | 21 | # Configure the docker image for kokoro-trampoline. 22 | env_vars: { 23 | key: "TRAMPOLINE_IMAGE" 24 | value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" 25 | } 26 | 27 | # Download secrets for samples 28 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" 29 | 30 | # Download trampoline resources. 31 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 32 | 33 | # Use the trampoline script to run in docker. 34 | build_file: "python-bigquery-dataframes/.kokoro/trampoline_v2.sh" -------------------------------------------------------------------------------- /.kokoro/samples/lint/continuous.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/lint/periodic.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "False" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/lint/presubmit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.10/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | # Specify which tests to run 11 | env_vars: { 12 | key: "RUN_TESTS_SESSION" 13 | value: "py-3.10" 14 | } 15 | 16 | # Declare build specific Cloud project. 17 | env_vars: { 18 | key: "BUILD_SPECIFIC_GCLOUD_PROJECT" 19 | value: "python-docs-samples-tests-310" 20 | } 21 | 22 | env_vars: { 23 | key: "TRAMPOLINE_BUILD_FILE" 24 | value: "github/python-bigquery-dataframes/.kokoro/test-samples.sh" 25 | } 26 | 27 | # Configure the docker image for kokoro-trampoline. 28 | env_vars: { 29 | key: "TRAMPOLINE_IMAGE" 30 | value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" 31 | } 32 | 33 | # Download secrets for samples 34 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" 35 | 36 | # Download trampoline resources. 37 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 38 | 39 | # Use the trampoline script to run in docker. 40 | build_file: "python-bigquery-dataframes/.kokoro/trampoline_v2.sh" -------------------------------------------------------------------------------- /.kokoro/samples/python3.10/continuous.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.10/periodic-head.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } 7 | 8 | env_vars: { 9 | key: "TRAMPOLINE_BUILD_FILE" 10 | value: "github/python-bigquery-dataframes/.kokoro/test-samples-against-head.sh" 11 | } 12 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.10/periodic.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "False" 6 | } 7 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.10/presubmit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.11/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | # Specify which tests to run 11 | env_vars: { 12 | key: "RUN_TESTS_SESSION" 13 | value: "py-3.11" 14 | } 15 | 16 | # Declare build specific Cloud project. 17 | env_vars: { 18 | key: "BUILD_SPECIFIC_GCLOUD_PROJECT" 19 | value: "python-docs-samples-tests-311" 20 | } 21 | 22 | env_vars: { 23 | key: "TRAMPOLINE_BUILD_FILE" 24 | value: "github/python-bigquery-dataframes/.kokoro/test-samples.sh" 25 | } 26 | 27 | # Configure the docker image for kokoro-trampoline. 28 | env_vars: { 29 | key: "TRAMPOLINE_IMAGE" 30 | value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" 31 | } 32 | 33 | # Download secrets for samples 34 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" 35 | 36 | # Download trampoline resources. 37 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 38 | 39 | # Use the trampoline script to run in docker. 40 | build_file: "python-bigquery-dataframes/.kokoro/trampoline_v2.sh" -------------------------------------------------------------------------------- /.kokoro/samples/python3.11/continuous.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.11/periodic-head.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } 7 | 8 | env_vars: { 9 | key: "TRAMPOLINE_BUILD_FILE" 10 | value: "github/python-bigquery-dataframes/.kokoro/test-samples-against-head.sh" 11 | } 12 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.11/periodic.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "False" 6 | } 7 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.11/presubmit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.12/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | # Specify which tests to run 11 | env_vars: { 12 | key: "RUN_TESTS_SESSION" 13 | value: "py-3.12" 14 | } 15 | 16 | # Declare build specific Cloud project. 17 | env_vars: { 18 | key: "BUILD_SPECIFIC_GCLOUD_PROJECT" 19 | value: "python-docs-samples-tests-312" 20 | } 21 | 22 | env_vars: { 23 | key: "TRAMPOLINE_BUILD_FILE" 24 | value: "github/python-bigquery-dataframes/.kokoro/test-samples.sh" 25 | } 26 | 27 | # Configure the docker image for kokoro-trampoline. 28 | env_vars: { 29 | key: "TRAMPOLINE_IMAGE" 30 | value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" 31 | } 32 | 33 | # Download secrets for samples 34 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" 35 | 36 | # Download trampoline resources. 37 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 38 | 39 | # Use the trampoline script to run in docker. 40 | build_file: "python-bigquery-dataframes/.kokoro/trampoline_v2.sh" -------------------------------------------------------------------------------- /.kokoro/samples/python3.12/continuous.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.12/periodic-head.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } 7 | 8 | env_vars: { 9 | key: "TRAMPOLINE_BUILD_FILE" 10 | value: "github/python-bigquery-dataframes/.kokoro/test-samples-against-head.sh" 11 | } 12 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.12/periodic.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "False" 6 | } 7 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.12/presubmit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.13/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | # Specify which tests to run 11 | env_vars: { 12 | key: "RUN_TESTS_SESSION" 13 | value: "py-3.13" 14 | } 15 | 16 | # Declare build specific Cloud project. 17 | env_vars: { 18 | key: "BUILD_SPECIFIC_GCLOUD_PROJECT" 19 | value: "python-docs-samples-tests-313" 20 | } 21 | 22 | env_vars: { 23 | key: "TRAMPOLINE_BUILD_FILE" 24 | value: "github/python-bigquery-dataframes/.kokoro/test-samples.sh" 25 | } 26 | 27 | # Configure the docker image for kokoro-trampoline. 28 | env_vars: { 29 | key: "TRAMPOLINE_IMAGE" 30 | value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" 31 | } 32 | 33 | # Download secrets for samples 34 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" 35 | 36 | # Download trampoline resources. 37 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 38 | 39 | # Use the trampoline script to run in docker. 40 | build_file: "python-bigquery-dataframes/.kokoro/trampoline_v2.sh" 41 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.13/continuous.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.13/periodic-head.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } 7 | 8 | env_vars: { 9 | key: "TRAMPOLINE_BUILD_FILE" 10 | value: "github/python-bigquery-dataframes/.kokoro/test-samples-against-head.sh" 11 | } 12 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.13/periodic.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "False" 6 | } 7 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.13/presubmit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.7/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | # Specify which tests to run 11 | env_vars: { 12 | key: "RUN_TESTS_SESSION" 13 | value: "py-3.7" 14 | } 15 | 16 | # Declare build specific Cloud project. 17 | env_vars: { 18 | key: "BUILD_SPECIFIC_GCLOUD_PROJECT" 19 | value: "python-docs-samples-tests-py37" 20 | } 21 | 22 | env_vars: { 23 | key: "TRAMPOLINE_BUILD_FILE" 24 | value: "github/python-bigquery-dataframes/.kokoro/test-samples.sh" 25 | } 26 | 27 | # Configure the docker image for kokoro-trampoline. 28 | env_vars: { 29 | key: "TRAMPOLINE_IMAGE" 30 | value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" 31 | } 32 | 33 | # Download secrets for samples 34 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" 35 | 36 | # Download trampoline resources. 37 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 38 | 39 | # Use the trampoline script to run in docker. 40 | build_file: "python-bigquery-dataframes/.kokoro/trampoline_v2.sh" -------------------------------------------------------------------------------- /.kokoro/samples/python3.7/continuous.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.7/periodic-head.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } 7 | 8 | env_vars: { 9 | key: "TRAMPOLINE_BUILD_FILE" 10 | value: "github/python-bigquery-dataframes/.kokoro/test-samples-against-head.sh" 11 | } 12 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.7/periodic.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "False" 6 | } 7 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.7/presubmit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.8/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | # Specify which tests to run 11 | env_vars: { 12 | key: "RUN_TESTS_SESSION" 13 | value: "py-3.8" 14 | } 15 | 16 | # Declare build specific Cloud project. 17 | env_vars: { 18 | key: "BUILD_SPECIFIC_GCLOUD_PROJECT" 19 | value: "python-docs-samples-tests-py38" 20 | } 21 | 22 | env_vars: { 23 | key: "TRAMPOLINE_BUILD_FILE" 24 | value: "github/python-bigquery-dataframes/.kokoro/test-samples.sh" 25 | } 26 | 27 | # Configure the docker image for kokoro-trampoline. 28 | env_vars: { 29 | key: "TRAMPOLINE_IMAGE" 30 | value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" 31 | } 32 | 33 | # Download secrets for samples 34 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" 35 | 36 | # Download trampoline resources. 37 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 38 | 39 | # Use the trampoline script to run in docker. 40 | build_file: "python-bigquery-dataframes/.kokoro/trampoline_v2.sh" -------------------------------------------------------------------------------- /.kokoro/samples/python3.8/continuous.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.8/periodic-head.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } 7 | 8 | env_vars: { 9 | key: "TRAMPOLINE_BUILD_FILE" 10 | value: "github/python-bigquery-dataframes/.kokoro/test-samples-against-head.sh" 11 | } 12 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.8/periodic.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "False" 6 | } 7 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.8/presubmit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.9/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | # Specify which tests to run 11 | env_vars: { 12 | key: "RUN_TESTS_SESSION" 13 | value: "py-3.9" 14 | } 15 | 16 | # Declare build specific Cloud project. 17 | env_vars: { 18 | key: "BUILD_SPECIFIC_GCLOUD_PROJECT" 19 | value: "python-docs-samples-tests-py39" 20 | } 21 | 22 | env_vars: { 23 | key: "TRAMPOLINE_BUILD_FILE" 24 | value: "github/python-bigquery-dataframes/.kokoro/test-samples.sh" 25 | } 26 | 27 | # Configure the docker image for kokoro-trampoline. 28 | env_vars: { 29 | key: "TRAMPOLINE_IMAGE" 30 | value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" 31 | } 32 | 33 | # Download secrets for samples 34 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" 35 | 36 | # Download trampoline resources. 37 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 38 | 39 | # Use the trampoline script to run in docker. 40 | build_file: "python-bigquery-dataframes/.kokoro/trampoline_v2.sh" -------------------------------------------------------------------------------- /.kokoro/samples/python3.9/continuous.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/samples/python3.9/periodic-head.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } 7 | 8 | env_vars: { 9 | key: "TRAMPOLINE_BUILD_FILE" 10 | value: "github/python-bigquery-dataframes/.kokoro/test-samples-against-head.sh" 11 | } 12 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.9/periodic.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "False" 6 | } 7 | -------------------------------------------------------------------------------- /.kokoro/samples/python3.9/presubmit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | env_vars: { 4 | key: "INSTALL_LIBRARY_FROM_SOURCE" 5 | value: "True" 6 | } -------------------------------------------------------------------------------- /.kokoro/test-samples-against-head.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2024 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # https://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # A customized test runner for samples. 17 | # 18 | # For periodic builds, you can specify this file for testing against head. 19 | 20 | # `-e` enables the script to automatically fail when a command fails 21 | # `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero 22 | set -eo pipefail 23 | # Enables `**` to include files nested inside sub-folders 24 | shopt -s globstar 25 | 26 | exec .kokoro/test-samples-impl.sh 27 | -------------------------------------------------------------------------------- /.kokoro/trampoline.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2024 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -eo pipefail 17 | 18 | # Always run the cleanup script, regardless of the success of bouncing into 19 | # the container. 20 | function cleanup() { 21 | chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh 22 | ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh 23 | echo "cleanup"; 24 | } 25 | trap cleanup EXIT 26 | 27 | $(dirname $0)/populate-secrets.sh # Secret Manager secrets. 28 | python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" -------------------------------------------------------------------------------- /.repo-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bigframes", 3 | "name_pretty": "A unified Python API in BigQuery", 4 | "product_documentation": "https://cloud.google.com/bigquery", 5 | "client_documentation": "https://cloud.google.com/python/docs/reference/bigframes/latest", 6 | "issue_tracker": "https://github.com/googleapis/python-bigquery-dataframes/issues", 7 | "release_level": "preview", 8 | "language": "python", 9 | "library_type": "INTEGRATION", 10 | "repo": "googleapis/python-bigquery-dataframes", 11 | "distribution_name": "bigframes", 12 | "api_id": "bigquery.googleapis.com", 13 | "default_version": "", 14 | "codeowner_team": "@googleapis/api-bigquery-dataframe", 15 | "api_shortname": "bigquery" 16 | } 17 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright 2024 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Generated by synthtool. DO NOT EDIT! 18 | include README.rst LICENSE 19 | recursive-include third_party/bigframes_vendored * 20 | recursive-include bigframes *.json *.proto py.typed 21 | recursive-include tests * 22 | global-exclude *.py[co] 23 | global-exclude __pycache__ 24 | 25 | # Exclude scripts for samples readmegen 26 | prune scripts/readme-gen 27 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | chelsealin@google.com 2 | garrettwu@google.com 3 | huanc@google.com 4 | jiaxun@google.com 5 | mlaurencechen@google.com 6 | shobs@google.com 7 | swast@google.com 8 | tbergeron@google.com -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). 4 | 5 | The Google Security Team will respond within 5 working days of your report on g.co/vulnz. 6 | 7 | We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. 8 | -------------------------------------------------------------------------------- /bigframes/_tools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """_tools is a collection of helper functions with minimal dependencies. 16 | 17 | Please keep the dependencies used in this subpackage to a minimum to avoid the 18 | risk of circular dependencies. 19 | """ 20 | -------------------------------------------------------------------------------- /bigframes/bigquery/_operations/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /bigframes/core/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from bigframes.core.array_value import ArrayValue 16 | 17 | __all__ = ["ArrayValue"] 18 | -------------------------------------------------------------------------------- /bigframes/core/compile/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import annotations 15 | 16 | from bigframes.core.compile.api import test_only_ibis_inferred_schema 17 | from bigframes.core.compile.compiler import compile_sql 18 | from bigframes.core.compile.configs import CompileRequest, CompileResult 19 | 20 | __all__ = [ 21 | "test_only_ibis_inferred_schema", 22 | "compile_sql", 23 | "CompileRequest", 24 | "CompileResult", 25 | ] 26 | -------------------------------------------------------------------------------- /bigframes/core/compile/constants.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | # Datetime constants 17 | UNIT_TO_US_CONVERSION_FACTORS = { 18 | "W": 7 * 24 * 60 * 60 * 1000 * 1000, 19 | "d": 24 * 60 * 60 * 1000 * 1000, 20 | "D": 24 * 60 * 60 * 1000 * 1000, 21 | "h": 60 * 60 * 1000 * 1000, 22 | "m": 60 * 1000 * 1000, 23 | "s": 1000 * 1000, 24 | "ms": 1000, 25 | "us": 1, 26 | "ns": 1e-3, 27 | } 28 | -------------------------------------------------------------------------------- /bigframes/core/compile/googlesql/abc.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from __future__ import annotations 16 | 17 | import abc 18 | 19 | 20 | class SQLSyntax(abc.ABC): 21 | """Abstract base class provides GoogleSQL syntax.""" 22 | 23 | @abc.abstractmethod 24 | def sql(self): 25 | ... 26 | -------------------------------------------------------------------------------- /bigframes/core/compile/googlesql/datatype.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import enum 16 | 17 | """This module represents all GoogleSQL for BigQuery data types: 18 | https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types""" 19 | 20 | 21 | class DataType(enum.Enum): 22 | STRING = 1 23 | FLOAT64 = 2 24 | -------------------------------------------------------------------------------- /bigframes/core/compile/polars/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import annotations 15 | 16 | import warnings 17 | 18 | try: 19 | import polars # noqa 20 | 21 | from bigframes.core.compile.polars.compiler import PolarsCompiler 22 | 23 | __all__ = ["PolarsCompiler"] 24 | except Exception: 25 | msg = "Polars compiler not available as polars is not installed." 26 | warnings.warn(msg) 27 | -------------------------------------------------------------------------------- /bigframes/core/compile/sqlglot/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import annotations 15 | 16 | from bigframes.core.compile.sqlglot.compiler import SQLGlotCompiler 17 | 18 | __all__ = ["SQLGlotCompiler"] 19 | -------------------------------------------------------------------------------- /bigframes/core/groupby/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from bigframes.core.groupby.dataframe_group_by import DataFrameGroupBy 16 | from bigframes.core.groupby.series_group_by import SeriesGroupBy 17 | 18 | __all__ = ["DataFrameGroupBy", "SeriesGroupBy"] 19 | -------------------------------------------------------------------------------- /bigframes/core/groupby/aggs.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from __future__ import annotations 16 | 17 | from bigframes.core import expression 18 | from bigframes.operations import aggregations as agg_ops 19 | 20 | 21 | def agg(input: str, op: agg_ops.AggregateOp) -> expression.Aggregation: 22 | if isinstance(op, agg_ops.UnaryAggregateOp): 23 | return expression.UnaryAggregation(op, expression.deref(input)) 24 | else: 25 | assert isinstance(op, agg_ops.NullaryAggregateOp) 26 | return expression.NullaryAggregation(op) 27 | -------------------------------------------------------------------------------- /bigframes/core/indexes/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from bigframes.core.indexes.base import Index 16 | from bigframes.core.indexes.datetimes import DatetimeIndex 17 | from bigframes.core.indexes.multi import MultiIndex 18 | 19 | __all__ = [ 20 | "Index", 21 | "MultiIndex", 22 | "DatetimeIndex", 23 | ] 24 | -------------------------------------------------------------------------------- /bigframes/core/reshape/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /bigframes/core/reshape/api.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from bigframes.core.reshape.concat import concat 16 | from bigframes.core.reshape.encoding import get_dummies 17 | from bigframes.core.reshape.merge import merge 18 | from bigframes.core.reshape.tile import cut, qcut 19 | 20 | __all__ = ["concat", "get_dummies", "merge", "cut", "qcut"] 21 | -------------------------------------------------------------------------------- /bigframes/core/scalar.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from __future__ import annotations 16 | 17 | from typing import Any 18 | 19 | # All public APIs return Any at present 20 | # Later implementation may sometimes return a lazy scalar 21 | Scalar = Any 22 | -------------------------------------------------------------------------------- /bigframes/core/tools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from bigframes.core.tools.datetimes import to_datetime 16 | 17 | __all__ = [ 18 | "to_datetime", 19 | ] 20 | -------------------------------------------------------------------------------- /bigframes/core/window/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from bigframes.core.window.rolling import Window 16 | 17 | __all__ = ["Window"] 18 | -------------------------------------------------------------------------------- /bigframes/functions/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /bigframes/geopandas/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from bigframes.geopandas.geoseries import GeoSeries 16 | 17 | __all__ = ["GeoSeries"] 18 | -------------------------------------------------------------------------------- /bigframes/ml/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """BigQuery DataFrames ML provides a SKLearn-like API on the BigQuery engine.""" 16 | 17 | __all__ = [ 18 | "cluster", 19 | "compose", 20 | "decomposition", 21 | "linear_model", 22 | "metrics", 23 | "model_selection", 24 | "pipeline", 25 | "preprocessing", 26 | "llm", 27 | "forecasting", 28 | "imported", 29 | "remote", 30 | ] 31 | -------------------------------------------------------------------------------- /bigframes/operations/bool_ops.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from bigframes.operations import base_ops 17 | import bigframes.operations.type as op_typing 18 | 19 | and_op = base_ops.create_binary_op(name="and", type_signature=op_typing.LOGICAL) 20 | 21 | or_op = base_ops.create_binary_op(name="or", type_signature=op_typing.LOGICAL) 22 | 23 | xor_op = base_ops.create_binary_op(name="xor", type_signature=op_typing.LOGICAL) 24 | -------------------------------------------------------------------------------- /bigframes/operations/distance_ops.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from bigframes.operations import base_ops 17 | import bigframes.operations.type as op_typing 18 | 19 | cosine_distance_op = base_ops.create_binary_op( 20 | name="ml_cosine_distance", type_signature=op_typing.VECTOR_METRIC 21 | ) 22 | 23 | manhattan_distance_op = base_ops.create_binary_op( 24 | name="ml_manhattan_distance", type_signature=op_typing.VECTOR_METRIC 25 | ) 26 | 27 | euclidean_distance_op = base_ops.create_binary_op( 28 | name="ml_euclidean_distance", type_signature=op_typing.VECTOR_METRIC 29 | ) 30 | -------------------------------------------------------------------------------- /bigframes/pandas/core/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /bigframes/pandas/core/api.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from bigframes.pandas.core.tools.timedeltas import to_timedelta 16 | 17 | __all__ = ["to_timedelta"] 18 | -------------------------------------------------------------------------------- /bigframes/pandas/core/tools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /bigframes/pandas/io/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /bigframes/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/bigframes/py.typed -------------------------------------------------------------------------------- /bigframes/session/_io/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /bigframes/session/temporary_storage.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from typing import Protocol, Sequence 16 | 17 | from google.cloud import bigquery 18 | 19 | 20 | class TemporaryStorageManager(Protocol): 21 | @property 22 | def location(self) -> str: 23 | ... 24 | 25 | def create_temp_table( 26 | self, schema: Sequence[bigquery.SchemaField], cluster_cols: Sequence[str] = [] 27 | ) -> bigquery.TableReference: 28 | ... 29 | 30 | # implementations should be robust to repeatedly closing 31 | def close(self) -> None: 32 | ... 33 | -------------------------------------------------------------------------------- /bigframes/testing/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """[Experimental] Utilities for testing BigQuery DataFrames. 16 | 17 | These modules are provided for testing the BigQuery DataFrames package. The 18 | interface is not considered stable. 19 | """ 20 | -------------------------------------------------------------------------------- /bigframes/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "2.5.0" 16 | 17 | # {x-release-please-start-date} 18 | __release_date__ = "2025-05-30" 19 | # {x-release-please-end} 20 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/README.rst: -------------------------------------------------------------------------------- 1 | ../README.rst -------------------------------------------------------------------------------- /docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | div#python2-eol { 2 | border-color: red; 3 | border-width: medium; 4 | } 5 | 6 | /* Ensure minimum width for 'Parameters' / 'Returns' column */ 7 | dl.field-list > dt { 8 | min-width: 100px 9 | } 10 | 11 | /* Insert space between methods for readability */ 12 | dl.method { 13 | padding-top: 10px; 14 | padding-bottom: 10px 15 | } 16 | 17 | /* Insert empty space between classes */ 18 | dl.class { 19 | padding-bottom: 50px 20 | } 21 | -------------------------------------------------------------------------------- /docs/changelog.md: -------------------------------------------------------------------------------- 1 | ../CHANGELOG.md -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: README.rst 2 | 3 | API reference 4 | ------------- 5 | 6 | .. toctree:: 7 | :maxdepth: 3 8 | 9 | reference/index 10 | supported_pandas_apis 11 | 12 | Changelog 13 | --------- 14 | 15 | For a list of all BigQuery DataFrames releases: 16 | 17 | .. toctree:: 18 | :maxdepth: 2 19 | 20 | changelog 21 | -------------------------------------------------------------------------------- /docs/reference/bigframes.bigquery/index.rst: -------------------------------------------------------------------------------- 1 | 2 | =========================== 3 | BigQuery Built-in Functions 4 | =========================== 5 | 6 | .. automodule:: bigframes.bigquery 7 | :members: 8 | :inherited-members: 9 | :undoc-members: 10 | -------------------------------------------------------------------------------- /docs/reference/bigframes.geopandas/geoseries.rst: -------------------------------------------------------------------------------- 1 | 2 | ========= 3 | GeoSeries 4 | ========= 5 | 6 | .. contents:: Table of Contents 7 | :depth: 2 8 | :local: 9 | :backlinks: none 10 | 11 | GeoSeries 12 | --------- 13 | 14 | .. autoclass:: bigframes.geopandas.GeoSeries 15 | :members: 16 | :inherited-members: 17 | :undoc-members: 18 | -------------------------------------------------------------------------------- /docs/reference/bigframes.geopandas/index.rst: -------------------------------------------------------------------------------- 1 | 2 | =============================== 3 | BigQuery DataFrames (geopandas) 4 | =============================== 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | geoseries 10 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/cluster.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.cluster 2 | ==================== 3 | 4 | .. automodule:: bigframes.ml.cluster 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/compose.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.compose 2 | ==================== 3 | 4 | .. automodule:: bigframes.ml.compose 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/decomposition.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.decomposition 2 | ========================== 3 | 4 | .. automodule:: bigframes.ml.decomposition 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/ensemble.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.ensemble 2 | ===================== 3 | 4 | .. automodule:: bigframes.ml.ensemble 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/forecasting.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.forecasting 2 | ======================== 3 | 4 | .. automodule:: bigframes.ml.forecasting 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/imported.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.imported 2 | ===================== 3 | 4 | .. automodule:: bigframes.ml.imported 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/impute.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.impute 2 | ========================== 3 | 4 | .. automodule:: bigframes.ml.impute 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/index.rst: -------------------------------------------------------------------------------- 1 | .. _bigframes_ml: 2 | .. include:: README.rst 3 | 4 | API Reference 5 | ------------- 6 | 7 | .. toctree:: 8 | :maxdepth: 3 9 | 10 | cluster 11 | 12 | compose 13 | 14 | decomposition 15 | 16 | ensemble 17 | 18 | forecasting 19 | 20 | imported 21 | 22 | impute 23 | 24 | linear_model 25 | 26 | llm 27 | 28 | metrics 29 | 30 | metrics.pairwise 31 | 32 | model_selection 33 | 34 | pipeline 35 | 36 | preprocessing 37 | 38 | remote 39 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/linear_model.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.linear_model 2 | ========================= 3 | 4 | .. automodule:: bigframes.ml.linear_model 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/llm.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.llm 2 | ================ 3 | 4 | .. automodule:: bigframes.ml.llm 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/metrics.pairwise.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.metrics.pairwise 2 | ============================= 3 | 4 | .. automodule:: bigframes.ml.metrics.pairwise 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/metrics.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.metrics 2 | ==================== 3 | 4 | .. automodule:: bigframes.ml.metrics 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/model_selection.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.model_selection 2 | ============================ 3 | 4 | .. automodule:: bigframes.ml.model_selection 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/pipeline.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.pipeline 2 | ===================== 3 | 4 | .. automodule:: bigframes.ml.pipeline 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/preprocessing.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.preprocessing 2 | ========================== 3 | 4 | .. automodule:: bigframes.ml.preprocessing 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.ml/remote.rst: -------------------------------------------------------------------------------- 1 | bigframes.ml.remote 2 | =================== 3 | 4 | .. automodule:: bigframes.ml.remote 5 | :members: 6 | :inherited-members: 7 | :undoc-members: 8 | -------------------------------------------------------------------------------- /docs/reference/bigframes.pandas/frame.rst: -------------------------------------------------------------------------------- 1 | 2 | ========= 3 | DataFrame 4 | ========= 5 | 6 | .. contents:: Table of Contents 7 | :depth: 2 8 | :local: 9 | :backlinks: none 10 | 11 | DataFrame 12 | --------- 13 | 14 | .. autoclass:: bigframes.dataframe.DataFrame 15 | :members: 16 | :inherited-members: 17 | :undoc-members: 18 | 19 | Accessors 20 | --------- 21 | 22 | Plotting handling 23 | ^^^^^^^^^^^^^^^^^ 24 | 25 | .. autoclass:: bigframes.operations.plotting.PlotAccessor 26 | :members: 27 | :inherited-members: 28 | :undoc-members: 29 | 30 | Struct handling 31 | ^^^^^^^^^^^^^^^ 32 | 33 | .. autoclass:: bigframes.operations.structs.StructFrameAccessor 34 | :members: 35 | :inherited-members: 36 | :undoc-members: 37 | 38 | AI operators 39 | ^^^^^^^^^^^^ 40 | 41 | .. autoclass:: bigframes.operations.ai.AIAccessor 42 | :members: 43 | :inherited-members: 44 | :undoc-members: -------------------------------------------------------------------------------- /docs/reference/bigframes.pandas/general_functions.rst: -------------------------------------------------------------------------------- 1 | 2 | ================= 3 | General functions 4 | ================= 5 | 6 | .. automodule:: bigframes.pandas 7 | :members: 8 | :undoc-members: 9 | :noindex: 10 | -------------------------------------------------------------------------------- /docs/reference/bigframes.pandas/groupby.rst: -------------------------------------------------------------------------------- 1 | 2 | ======= 3 | GroupBy 4 | ======= 5 | 6 | DataFrameGroupBy 7 | ---------------- 8 | 9 | .. autoclass:: bigframes.core.groupby.DataFrameGroupBy 10 | :members: 11 | :inherited-members: 12 | :undoc-members: 13 | 14 | SeriesGroupBy 15 | ------------- 16 | 17 | .. autoclass:: bigframes.core.groupby.SeriesGroupBy 18 | :members: 19 | :inherited-members: 20 | :undoc-members: 21 | -------------------------------------------------------------------------------- /docs/reference/bigframes.pandas/index.rst: -------------------------------------------------------------------------------- 1 | 2 | ============================ 3 | BigQuery DataFrames (pandas) 4 | ============================ 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | general_functions 10 | series 11 | frame 12 | indexers 13 | indexing 14 | window 15 | groupby 16 | options 17 | -------------------------------------------------------------------------------- /docs/reference/bigframes.pandas/indexing.rst: -------------------------------------------------------------------------------- 1 | 2 | ============= 3 | Index objects 4 | ============= 5 | 6 | .. autoclass:: bigframes.core.indexes.base.Index 7 | :members: 8 | :inherited-members: 9 | :undoc-members: 10 | 11 | 12 | .. autoclass:: bigframes.core.indexes.multi.MultiIndex 13 | :members: 14 | :inherited-members: 15 | :undoc-members: 16 | 17 | 18 | .. autoclass:: bigframes.core.indexes.datetimes.DatetimeIndex 19 | :members: 20 | :inherited-members: 21 | :undoc-members: -------------------------------------------------------------------------------- /docs/reference/bigframes.pandas/options.rst: -------------------------------------------------------------------------------- 1 | 2 | ==================== 3 | Options and settings 4 | ==================== 5 | 6 | ``bigframes.pandas.options`` is an alias for :data:`bigframes.options`. 7 | -------------------------------------------------------------------------------- /docs/reference/bigframes.pandas/window.rst: -------------------------------------------------------------------------------- 1 | 2 | ====== 3 | Window 4 | ====== 5 | 6 | .. autoclass:: bigframes.core.window.Window 7 | :members: 8 | :inherited-members: 9 | :undoc-members: 10 | -------------------------------------------------------------------------------- /docs/reference/bigframes.streaming/dataframe.rst: -------------------------------------------------------------------------------- 1 | bigframes.streaming.dataframe 2 | ============================= 3 | 4 | .. autoclass:: bigframes.streaming.dataframe.StreamingDataFrame 5 | :members: 6 | :inherited-members: 7 | -------------------------------------------------------------------------------- /docs/reference/bigframes.streaming/index.rst: -------------------------------------------------------------------------------- 1 | 2 | ============================ 3 | BigQuery DataFrame Streaming 4 | ============================ 5 | 6 | .. automodule:: bigframes.streaming 7 | :members: 8 | :undoc-members: 9 | 10 | .. toctree:: 11 | :maxdepth: 2 12 | 13 | dataframe 14 | -------------------------------------------------------------------------------- /docs/reference/bigframes/enums.rst: -------------------------------------------------------------------------------- 1 | 2 | ===== 3 | Enums 4 | ===== 5 | 6 | .. automodule:: bigframes.enums 7 | :members: 8 | :undoc-members: 9 | -------------------------------------------------------------------------------- /docs/reference/bigframes/exceptions.rst: -------------------------------------------------------------------------------- 1 | 2 | ======================= 3 | Exceptions and Warnings 4 | ======================= 5 | 6 | .. automodule:: bigframes.exceptions 7 | :members: 8 | :undoc-members: 9 | -------------------------------------------------------------------------------- /docs/reference/bigframes/index.rst: -------------------------------------------------------------------------------- 1 | 2 | ============ 3 | Core objects 4 | ============ 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | enums 10 | exceptions 11 | options 12 | 13 | 14 | Session 15 | ------- 16 | 17 | .. autofunction:: bigframes.connect 18 | 19 | .. autoclass:: bigframes.session.Session 20 | :members: 21 | :inherited-members: 22 | :undoc-members: 23 | -------------------------------------------------------------------------------- /docs/reference/bigframes/options.rst: -------------------------------------------------------------------------------- 1 | Options and settings 2 | ==================== 3 | 4 | .. currentmodule:: bigframes 5 | 6 | .. autodata:: options 7 | 8 | .. autoclass:: bigframes._config.Options 9 | 10 | .. autoclass:: bigframes._config.bigquery_options.BigQueryOptions 11 | 12 | .. autoclass:: bigframes._config.display_options.DisplayOptions 13 | 14 | .. autoclass:: bigframes._config.sampling_options.SamplingOptions 15 | 16 | .. autoclass:: bigframes._config.compute_options.ComputeOptions 17 | -------------------------------------------------------------------------------- /docs/reference/index.rst: -------------------------------------------------------------------------------- 1 | API Reference 2 | ============= 3 | 4 | Refer to these pages for details about the public objects in the ``bigframes`` 5 | packages. 6 | 7 | .. toctree:: 8 | :maxdepth: 2 9 | 10 | bigframes/index 11 | bigframes.bigquery/index 12 | bigframes.geopandas/index 13 | bigframes.ml/index 14 | bigframes.pandas/index 15 | bigframes.streaming/index 16 | -------------------------------------------------------------------------------- /docs/supported_pandas_apis/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | # https://mypy.readthedocs.io/en/stable/config_file.html#config-file 2 | 3 | [mypy] 4 | exclude = ^third_party/ 5 | 6 | [mypy-google.auth.*] 7 | ignore_missing_imports = True 8 | 9 | [mypy-cloudpickle.*] 10 | ignore_missing_imports = True 11 | 12 | [mypy-flask] 13 | ignore_missing_imports = True 14 | 15 | [mypy-pydata_google_auth] 16 | ignore_missing_imports = True 17 | 18 | [mypy-google.colab] 19 | ignore_missing_imports = True 20 | 21 | [mypy-google.iam.*] 22 | ignore_missing_imports = True 23 | 24 | [mypy-pytz] 25 | ignore_missing_imports = True 26 | 27 | [mypy-pyarrow] 28 | ignore_missing_imports = True 29 | 30 | [mypy-ibis.*] 31 | ignore_missing_imports = True 32 | 33 | [mypy-ipywidgets] 34 | ignore_missing_imports = True 35 | 36 | [mypy-pyarrow.feather] 37 | ignore_missing_imports = True 38 | 39 | [mypy-google.cloud.pubsub] 40 | ignore_missing_imports = True 41 | 42 | [mypy-google.cloud.bigtable] 43 | ignore_missing_imports = True 44 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools"] 3 | build-backend = "setuptools.build_meta" 4 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | doctest_optionflags = NORMALIZE_WHITESPACE 3 | filterwarnings = 4 | ignore::pandas.errors.SettingWithCopyWarning 5 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base", 4 | "group:all", 5 | ":preserveSemverRanges", 6 | ":disableDependencyDashboard" 7 | ], 8 | "ignorePaths": [".pre-commit-config.yaml", ".kokoro/requirements.txt", "setup.py", ".github/workflows/unittest.yml"], 9 | "pip_requirements": { 10 | "fileMatch": ["requirements-test.txt", "samples/[\\S/]*constraints.txt", "samples/[\\S/]*constraints-test.txt"] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /samples/polars/requirements-test.txt: -------------------------------------------------------------------------------- 1 | # samples/snippets should be runnable with no "extras" 2 | google-cloud-testutils==1.4.0 3 | pytest==8.3.2 4 | -------------------------------------------------------------------------------- /samples/polars/requirements.txt: -------------------------------------------------------------------------------- 1 | bigframes==1.11.1 2 | polars==1.3.0 3 | pyarrow==15.0.0 4 | -------------------------------------------------------------------------------- /samples/snippets/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /samples/snippets/load_data_from_bigquery_test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | def test_bigquery_dataframes_load_data_from_bigquery() -> None: 17 | # [START bigquery_dataframes_load_data_from_bigquery] 18 | # Create a DataFrame from a BigQuery table: 19 | import bigframes.pandas as bpd 20 | 21 | query_or_table = "bigquery-public-data.ml_datasets.penguins" 22 | bq_df = bpd.read_gbq(query_or_table) 23 | # [END bigquery_dataframes_load_data_from_bigquery] 24 | assert bq_df is not None 25 | -------------------------------------------------------------------------------- /samples/snippets/load_data_from_csv_test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | def test_bigquery_dataframes_load_data_from_csv() -> None: 17 | # [START bigquery_dataframes_load_data_from_csv] 18 | import bigframes.pandas as bpd 19 | 20 | filepath_or_buffer = "gs://cloud-samples-data/bigquery/us-states/us-states.csv" 21 | df_from_gcs = bpd.read_csv(filepath_or_buffer) 22 | # Display the first few rows of the DataFrame: 23 | df_from_gcs.head() 24 | # [END bigquery_dataframes_load_data_from_csv] 25 | assert df_from_gcs is not None 26 | -------------------------------------------------------------------------------- /samples/snippets/requirements-test.txt: -------------------------------------------------------------------------------- 1 | # samples/snippets should be runnable with no "extras" 2 | google-cloud-testutils==1.4.0 3 | pytest==8.3.2 4 | -------------------------------------------------------------------------------- /samples/snippets/requirements.txt: -------------------------------------------------------------------------------- 1 | # samples/snippets should be runnable with no "extras" 2 | bigframes==1.11.1 3 | -------------------------------------------------------------------------------- /scratch/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore all files in this directory. 2 | * 3 | -------------------------------------------------------------------------------- /scripts/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /scripts/data/images/img0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/scripts/data/images/img0.jpg -------------------------------------------------------------------------------- /scripts/data/images/img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/scripts/data/images/img1.jpg -------------------------------------------------------------------------------- /scripts/data/images_exif/test_image_exif.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/scripts/data/images_exif/test_image_exif.jpg -------------------------------------------------------------------------------- /scripts/notebooks_restore_from_backup.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import pathlib 16 | import shutil 17 | import sys 18 | 19 | 20 | def restore_from_backup(notebook_path): 21 | backup_path = pathlib.Path(f"{notebook_path}.backup") 22 | if backup_path.exists(): 23 | shutil.move( 24 | backup_path, 25 | notebook_path, 26 | ) 27 | 28 | 29 | def main(notebook_paths): 30 | for notebook_path in notebook_paths: 31 | restore_from_backup(notebook_path) 32 | 33 | 34 | if __name__ == "__main__": 35 | main(sys.argv[1:]) 36 | -------------------------------------------------------------------------------- /scripts/readme-gen/templates/auth.tmpl.rst: -------------------------------------------------------------------------------- 1 | Authentication 2 | ++++++++++++++ 3 | 4 | This sample requires you to have authentication setup. Refer to the 5 | `Authentication Getting Started Guide`_ for instructions on setting up 6 | credentials for applications. 7 | 8 | .. _Authentication Getting Started Guide: 9 | https://cloud.google.com/docs/authentication/getting-started 10 | -------------------------------------------------------------------------------- /scripts/readme-gen/templates/auth_api_key.tmpl.rst: -------------------------------------------------------------------------------- 1 | Authentication 2 | ++++++++++++++ 3 | 4 | Authentication for this service is done via an `API Key`_. To obtain an API 5 | Key: 6 | 7 | 1. Open the `Cloud Platform Console`_ 8 | 2. Make sure that billing is enabled for your project. 9 | 3. From the **Credentials** page, create a new **API Key** or use an existing 10 | one for your project. 11 | 12 | .. _API Key: 13 | https://developers.google.com/api-client-library/python/guide/aaa_apikeys 14 | .. _Cloud Console: https://console.cloud.google.com/project?_ 15 | -------------------------------------------------------------------------------- /scripts/readme-gen/templates/install_deps.tmpl.rst: -------------------------------------------------------------------------------- 1 | Install Dependencies 2 | ++++++++++++++++++++ 3 | 4 | #. Clone python-docs-samples and change directory to the sample directory you want to use. 5 | 6 | .. code-block:: bash 7 | 8 | $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git 9 | 10 | #. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. 11 | 12 | .. _Python Development Environment Setup Guide: 13 | https://cloud.google.com/python/setup 14 | 15 | #. Create a virtualenv. Samples are compatible with Python 3.7+. 16 | 17 | .. code-block:: bash 18 | 19 | $ virtualenv env 20 | $ source env/bin/activate 21 | 22 | #. Install the dependencies needed to run the samples. 23 | 24 | .. code-block:: bash 25 | 26 | $ pip install -r requirements.txt 27 | 28 | .. _pip: https://pip.pypa.io/ 29 | .. _virtualenv: https://virtualenv.pypa.io/ 30 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright 2023 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # Generated by synthtool. DO NOT EDIT! 18 | [bdist_wheel] 19 | universal = 1 20 | -------------------------------------------------------------------------------- /testing/.gitignore: -------------------------------------------------------------------------------- 1 | test-env.sh 2 | service-account.json 3 | client-secrets.json -------------------------------------------------------------------------------- /testing/constraints-3.10.txt: -------------------------------------------------------------------------------- 1 | # Keep in sync with colab/containers/requirements.core.in image 2 | google-auth==2.27.0 3 | ipykernel==5.5.6 4 | ipython==7.34.0 5 | notebook==6.5.5 6 | pandas==2.1.4 7 | pandas-stubs==2.1.4.231227 8 | portpicker==1.5.2 9 | requests==2.32.3 10 | tornado==6.3.3 11 | absl-py==1.4.0 12 | debugpy==1.6.6 13 | ipywidgets==7.7.1 14 | matplotlib==3.7.1 15 | psutil==5.9.5 16 | seaborn==0.13.1 17 | traitlets==5.7.1 18 | -------------------------------------------------------------------------------- /testing/constraints-3.11.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/testing/constraints-3.11.txt -------------------------------------------------------------------------------- /testing/constraints-3.12.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/testing/constraints-3.12.txt -------------------------------------------------------------------------------- /testing/constraints-3.13.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/testing/constraints-3.13.txt -------------------------------------------------------------------------------- /testing/constraints-3.14.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/testing/constraints-3.14.txt -------------------------------------------------------------------------------- /testing/constraints-3.15.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/testing/constraints-3.15.txt -------------------------------------------------------------------------------- /testing/constraints-3.9.txt: -------------------------------------------------------------------------------- 1 | # please keep these in sync with the minimum versions in setup.py 2 | cloudpickle==2.0.0 3 | fsspec==2023.3.0 4 | gcsfs==2023.3.0 5 | geopandas==0.12.2 6 | google-auth==2.15.0 7 | google-cloud-bigtable==2.24.0 8 | google-cloud-pubsub==2.21.4 9 | google-cloud-bigquery==3.31.0 10 | google-cloud-functions==1.12.0 11 | google-cloud-bigquery-connection==1.12.0 12 | google-cloud-iam==2.12.1 13 | google-cloud-resource-manager==1.10.3 14 | google-cloud-storage==2.0.0 15 | numpy==1.24.0 16 | pandas==1.5.3 17 | pandas-gbq==0.26.1 18 | pyarrow==15.0.2 19 | pydata-google-auth==1.8.2 20 | requests==2.27.1 21 | scikit-learn==1.2.2 22 | shapely==1.8.5 23 | sqlglot==23.6.3 24 | tabulate==0.9 25 | ipywidgets==7.7.1 26 | humanize==4.6.0 27 | matplotlib==3.7.1 28 | db-dtypes==1.4.2 29 | # For vendored ibis-framework. 30 | atpublic==2.3 31 | python-dateutil==2.8.2 32 | pytz==2022.7 33 | toolz==0.11 34 | typing-extensions==4.5.0 35 | rich==12.4.4 36 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/benchmark/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/benchmark/db_benchmark/groupby/config.jsonl: -------------------------------------------------------------------------------- 1 | {"benchmark_suffix": "50g_ordered", "project_id": "bigframes-dev-perf", "dataset_id": "dbbenchmark", "table_id": "G1_1e9_1e2_5_0", "ordered": true} 2 | {"benchmark_suffix": "50g_unordered", "project_id": "bigframes-dev-perf", "dataset_id": "dbbenchmark", "table_id": "G1_1e9_1e2_5_0", "ordered": false} 3 | -------------------------------------------------------------------------------- /tests/benchmark/db_benchmark/join/config.jsonl: -------------------------------------------------------------------------------- 1 | {"benchmark_suffix": "50g_ordered", "project_id": "bigframes-dev-perf", "dataset_id": "dbbenchmark", "table_id": "J1_1e9_NA_0_0", "ordered": true} 2 | {"benchmark_suffix": "50g_unordered", "project_id": "bigframes-dev-perf", "dataset_id": "dbbenchmark", "table_id": "J1_1e9_NA_0_0", "ordered": false} 3 | -------------------------------------------------------------------------------- /tests/benchmark/db_benchmark/sort/config.jsonl: -------------------------------------------------------------------------------- 1 | {"benchmark_suffix": "50g_ordered", "project_id": "bigframes-dev-perf", "dataset_id": "dbbenchmark", "table_id": "J1_1e9_NA_0_0", "ordered": true} 2 | {"benchmark_suffix": "50g_unordered", "project_id": "bigframes-dev-perf", "dataset_id": "dbbenchmark", "table_id": "J1_1e9_NA_0_0", "ordered": false} 3 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/config.jsonl: -------------------------------------------------------------------------------- 1 | {"benchmark_suffix": "1g_ordered", "project_id": "bigframes-dev-perf", "dataset_id": "tpch_0001g", "ordered": true} 2 | {"benchmark_suffix": "1g_unordered", "project_id": "bigframes-dev-perf", "dataset_id": "tpch_0001g", "ordered": false} 3 | {"benchmark_suffix": "10g_ordered", "project_id": "bigframes-dev-perf", "dataset_id": "tpch_0010g", "ordered": true} 4 | {"benchmark_suffix": "10g_unordered", "project_id": "bigframes-dev-perf", "dataset_id": "tpch_0010g", "ordered": false} 5 | {"benchmark_suffix": "100g_ordered", "project_id": "bigframes-dev-perf", "dataset_id": "tpch_0100g", "ordered": true} 6 | {"benchmark_suffix": "100g_unordered", "project_id": "bigframes-dev-perf", "dataset_id": "tpch_0100g", "ordered": false} 7 | {"benchmark_suffix": "1t_ordered", "project_id": "bigframes-dev-perf", "dataset_id": "tpch_0001t", "ordered": true} 8 | {"benchmark_suffix": "1t_unordered", "project_id": "bigframes-dev-perf", "dataset_id": "tpch_0001t", "ordered": false} 9 | {"benchmark_suffix": "10t_ordered", "project_id": "bigframes-dev-perf", "dataset_id": "tpch_0010t", "ordered": true} 10 | {"benchmark_suffix": "10t_unordered", "project_id": "bigframes-dev-perf", "dataset_id": "tpch_0010t", "ordered": false} 11 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q1.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q1 as vendored_tpch_q1 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q1.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q10.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q10 as vendored_tpch_q10 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q10.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q11.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q11 as vendored_tpch_q11 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q11.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q12.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q12 as vendored_tpch_q12 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q12.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q13.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q13 as vendored_tpch_q13 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q13.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q14.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q14 as vendored_tpch_q14 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q14.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q15.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q15 as vendored_tpch_q15 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q15.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q16.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q16 as vendored_tpch_q16 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q16.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q17.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q17 as vendored_tpch_q17 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q17.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q18.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q18 as vendored_tpch_q18 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q18.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q19.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q19 as vendored_tpch_q19 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q19.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q2.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q2 as vendored_tpch_q2 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q2.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q20.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q20 as vendored_tpch_q20 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q20.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q21.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q21 as vendored_tpch_q21 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q21.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q22.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q22 as vendored_tpch_q22 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q22.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q3.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q3 as vendored_tpch_q3 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q3.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q4.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q4 as vendored_tpch_q4 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q4.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q5.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q5 as vendored_tpch_q5 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q5.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q6.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q6 as vendored_tpch_q6 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q6.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q7.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q7 as vendored_tpch_q7 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q7.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q8.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q8 as vendored_tpch_q8 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q8.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/benchmark/tpch/q9.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | import pathlib 15 | 16 | import benchmark.utils as utils 17 | import bigframes_vendored.tpch.queries.q9 as vendored_tpch_q9 18 | 19 | if __name__ == "__main__": 20 | project_id, dataset_id, session, suffix = utils.get_configuration() 21 | current_path = pathlib.Path(__file__).absolute() 22 | 23 | utils.get_execution_time( 24 | vendored_tpch_q9.q, current_path, suffix, project_id, dataset_id, session 25 | ) 26 | -------------------------------------------------------------------------------- /tests/data/hockey_players.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "mode": "NULLABLE", 4 | "name": "team_name", 5 | "type": "STRING" 6 | }, 7 | { 8 | "mode": "NULLABLE", 9 | "name": "position", 10 | "type": "STRING" 11 | }, 12 | { 13 | "mode": "NULLABLE", 14 | "name": "player_name", 15 | "type": "STRING" 16 | }, 17 | { 18 | "mode": "NULLABLE", 19 | "name": "goals", 20 | "type": "INTEGER" 21 | }, 22 | { 23 | "mode": "NULLABLE", 24 | "name": "assists", 25 | "type": "INTEGER" 26 | }, 27 | { 28 | "mode": "NULLABLE", 29 | "name": "number", 30 | "type": "INTEGER" 31 | }, 32 | { 33 | "mode": "NULLABLE", 34 | "name": "season", 35 | "type": "INTEGER" 36 | } 37 | ] 38 | -------------------------------------------------------------------------------- /tests/data/json.jsonl: -------------------------------------------------------------------------------- 1 | {"rowindex": 0, "json_col": null} 2 | {"rowindex": 1, "json_col": true} 3 | {"rowindex": 2, "json_col": 100} 4 | {"rowindex": 3, "json_col": 0.98} 5 | {"rowindex": 4, "json_col": "a string"} 6 | {"rowindex": 5, "json_col": []} 7 | {"rowindex": 6, "json_col": [1, 2, 3]} 8 | {"rowindex": 7, "json_col": [{"a": 1}, {"a": 2}, {"a": null}, {}]} 9 | {"rowindex": 8, "json_col": "100"} 10 | {"rowindex": 9, "json_col": {"folat_num": 3.14159}} 11 | {"rowindex": 10, "json_col": {"date": "2024-07-16"}} 12 | {"rowindex": 11, "json_col": 100} 13 | {"rowindex": 12, "json_col": {"int_value": 2, "null_filed": null}} 14 | {"rowindex": 13, "json_col": {"list_data": [10, 20, 30]}} 15 | {"rowindex": 14, "json_col": {"person": {"name": "Alice", "age": 35}}} 16 | {"rowindex": 15, "json_col": {"order": {"items": ["book", "pen"], "total": 15.99}}} 17 | -------------------------------------------------------------------------------- /tests/data/json_schema.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "rowindex", 4 | "type": "INTEGER", 5 | "mode": "REQUIRED" 6 | }, 7 | { 8 | "name": "json_col", 9 | "type": "JSON", 10 | "mode": "NULLABLE" 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /tests/data/matrix_2by3.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "mode": "REQUIRED", 4 | "name": "rowindex", 5 | "type": "INTEGER" 6 | }, 7 | { 8 | "mode": "NULLABLE", 9 | "name": "a", 10 | "type": "INTEGER" 11 | }, 12 | { 13 | "mode": "NULLABLE", 14 | "name": "b", 15 | "type": "INTEGER" 16 | }, 17 | { 18 | "mode": "NULLABLE", 19 | "name": "c", 20 | "type": "INTEGER" 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /tests/data/matrix_2by3.jsonl: -------------------------------------------------------------------------------- 1 | {"rowindex": 0, "a": 1, "b": 2, "c": 3} 2 | {"rowindex": 1, "a": 2, "b": 5, "c": 7} 3 | -------------------------------------------------------------------------------- /tests/data/matrix_3by4.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "mode": "REQUIRED", 4 | "name": "rowindex", 5 | "type": "STRING" 6 | }, 7 | { 8 | "mode": "NULLABLE", 9 | "name": "w", 10 | "type": "INTEGER" 11 | }, 12 | { 13 | "mode": "NULLABLE", 14 | "name": "x", 15 | "type": "INTEGER" 16 | }, 17 | { 18 | "mode": "NULLABLE", 19 | "name": "y", 20 | "type": "INTEGER" 21 | }, 22 | { 23 | "mode": "NULLABLE", 24 | "name": "z", 25 | "type": "INTEGER" 26 | } 27 | ] 28 | -------------------------------------------------------------------------------- /tests/data/matrix_3by4.jsonl: -------------------------------------------------------------------------------- 1 | {"rowindex": "a", "w": 2, "x": 4, "y": 8, "z": 21} 2 | {"rowindex": "b", "w": 1, "x": 5, "y": 10, "z": -11} 3 | {"rowindex": "c", "w": 3, "x": 6, "y": 9, "z": 0} 4 | -------------------------------------------------------------------------------- /tests/data/nested_structs.jsonl: -------------------------------------------------------------------------------- 1 | {"id": 1, "person": {"name": "Alice", "age":30, "address": {"city": "New York", "country": "USA"}}} 2 | {"id": 2, "person": {"name": "Bob", "age":25, "address": {"city": "London", "country": "UK"}}} -------------------------------------------------------------------------------- /tests/data/nested_structs_schema.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "id", 4 | "type": "INTEGER", 5 | "mode": "REQUIRED" 6 | }, 7 | { 8 | "name": "person", 9 | "type": "RECORD", 10 | "fields": [ 11 | { 12 | "name": "name", 13 | "type": "STRING", 14 | "mode": "NULLABLE" 15 | }, 16 | { 17 | "name": "age", 18 | "type": "INTEGER", 19 | "mode": "NULLABLE" 20 | }, 21 | { 22 | "name": "address", 23 | "type": "RECORD", 24 | "fields": [ 25 | { 26 | "name": "city", 27 | "type": "STRING", 28 | "mode": "NULLABLE" 29 | }, 30 | { 31 | "name": "country", 32 | "type": "STRING", 33 | "mode": "NULLABLE" 34 | } 35 | ] 36 | } 37 | ] 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /tests/data/penguins_schema.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "mode": "NULLABLE", 4 | "name": "species", 5 | "type": "STRING" 6 | }, 7 | { 8 | "mode": "NULLABLE", 9 | "name": "island", 10 | "type": "STRING" 11 | }, 12 | { 13 | "mode": "NULLABLE", 14 | "name": "culmen_length_mm", 15 | "type": "FLOAT" 16 | }, 17 | { 18 | "mode": "NULLABLE", 19 | "name": "culmen_depth_mm", 20 | "type": "FLOAT" 21 | }, 22 | { 23 | "mode": "NULLABLE", 24 | "name": "flipper_length_mm", 25 | "type": "FLOAT" 26 | }, 27 | { 28 | "mode": "NULLABLE", 29 | "name": "body_mass_g", 30 | "type": "FLOAT" 31 | }, 32 | { 33 | "mode": "NULLABLE", 34 | "name": "sex", 35 | "type": "STRING" 36 | } 37 | ] 38 | -------------------------------------------------------------------------------- /tests/data/people.csv: -------------------------------------------------------------------------------- 1 | Name,Age,City 2 | Alice,25,New York 3 | Bob,30,London 4 | Charlie,22,Paris 5 | -------------------------------------------------------------------------------- /tests/data/ratings.jsonl: -------------------------------------------------------------------------------- 1 | {"user_id": 1, "item_id": 2, "rating": 4.0} 2 | {"user_id": 1, "item_id": 5, "rating": 3.0} 3 | {"user_id": 2, "item_id": 1, "rating": 5.0} 4 | {"user_id": 2, "item_id": 3, "rating": 2.0} 5 | {"user_id": 3, "item_id": 4, "rating": 4.5} 6 | {"user_id": 3, "item_id": 7, "rating": 3.5} 7 | {"user_id": 4, "item_id": 2, "rating": 1.0} 8 | {"user_id": 4, "item_id": 8, "rating": 5.0} 9 | {"user_id": 5, "item_id": 3, "rating": 4.0} 10 | {"user_id": 5, "item_id": 9, "rating": 2.5} 11 | {"user_id": 6, "item_id": 1, "rating": 3.0} 12 | {"user_id": 6, "item_id": 6, "rating": 4.5} 13 | {"user_id": 7, "item_id": 5, "rating": 5.0} 14 | {"user_id": 7, "item_id": 10, "rating": 1.5} 15 | {"user_id": 8, "item_id": 4, "rating": 2.0} 16 | {"user_id": 8, "item_id": 7, "rating": 4.0} 17 | {"user_id": 9, "item_id": 2, "rating": 3.5} 18 | {"user_id": 9, "item_id": 9, "rating": 5.0} 19 | {"user_id": 10, "item_id": 3, "rating": 4.5} 20 | {"user_id": 10, "item_id": 8, "rating": 2.5} 21 | -------------------------------------------------------------------------------- /tests/data/ratings_schema.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "mode": "NULLABLE", 4 | "name": "user_id", 5 | "type": "STRING" 6 | }, 7 | { 8 | "mode": "NULLABLE", 9 | "name": "item_id", 10 | "type": "INT64" 11 | }, 12 | { 13 | "mode": "NULLABLE", 14 | "name": "rating", 15 | "type": "FLOAT" 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /tests/data/repeated.jsonl: -------------------------------------------------------------------------------- 1 | {"rowindex": 0, "int_list_col": [1], "bool_list_col": [true], "float_list_col": [1.2, 2.3], "date_list_col": ["2021-07-21"], "date_time_list_col": ["2021-07-21 11:39:45"], "numeric_list_col": [1.2, 2.3, 3.4], "string_list_col": ["abc", "de", "f"]} 2 | {"rowindex": 1, "int_list_col": [1,2], "bool_list_col": [true, false], "float_list_col": [1.1], "date_list_col": ["2021-07-21", "1987-03-28"], "date_time_list_col": ["1999-03-14 17:22:00"], "numeric_list_col": [5.5, 2.3], "string_list_col": ["a", "bc", "de"]} 3 | {"rowindex": 2, "int_list_col": [1,2,3], "bool_list_col": [true], "float_list_col": [0.5, -1.9, 2.3], "date_list_col": ["2017-08-01", "2004-11-22"], "date_time_list_col": ["1979-06-03 03:20:45"], "numeric_list_col": [1.7], "string_list_col": ["", "a"]} 4 | -------------------------------------------------------------------------------- /tests/data/repeated_schema.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "rowindex", 4 | "type": "INTEGER", 5 | "mode": "REQUIRED" 6 | }, 7 | { 8 | "name": "int_list_col", 9 | "type": "INTEGER", 10 | "mode": "REPEATED" 11 | }, 12 | { 13 | "name": "bool_list_col", 14 | "type": "BOOLEAN", 15 | "mode": "REPEATED" 16 | }, 17 | { 18 | "name": "float_list_col", 19 | "type": "FLOAT", 20 | "mode": "REPEATED" 21 | }, 22 | { 23 | "name": "date_list_col", 24 | "type": "DATE", 25 | "mode": "REPEATED" 26 | }, 27 | { 28 | "name": "date_time_list_col", 29 | "type": "DATETIME", 30 | "mode": "REPEATED" 31 | }, 32 | { 33 | "name": "numeric_list_col", 34 | "type": "NUMERIC", 35 | "mode": "REPEATED" 36 | }, 37 | { 38 | "name": "string_list_col", 39 | "type": "STRING", 40 | "mode": "REPEATED" 41 | } 42 | ] 43 | -------------------------------------------------------------------------------- /tests/data/time_series_schema.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "mode": "NULLABLE", 4 | "name": "parsed_date", 5 | "type": "TIMESTAMP" 6 | }, 7 | { 8 | "mode": "NULLABLE", 9 | "name": "id", 10 | "type": "STRING" 11 | }, 12 | { 13 | "mode": "NULLABLE", 14 | "name": "total_visits", 15 | "type": "INTEGER" 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /tests/system/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/large/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/large/functions/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/large/operations/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/small/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/small/bigquery/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/small/blob/test_urls.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import bigframes.pandas as bpd 16 | 17 | 18 | def test_blob_read_url(images_mm_df: bpd.DataFrame): 19 | urls = images_mm_df["blob_col"].blob.read_url() 20 | 21 | assert urls.str.startswith("https://storage.googleapis.com/").all() 22 | 23 | 24 | def test_blob_write_url(images_mm_df: bpd.DataFrame): 25 | urls = images_mm_df["blob_col"].blob.write_url() 26 | 27 | assert urls.str.startswith("https://storage.googleapis.com/").all() 28 | -------------------------------------------------------------------------------- /tests/system/small/core/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/small/core/indexes/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/small/functions/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/small/ml/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/small/operations/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/small/session/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/system/small/test_scalar.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import pandas 16 | 17 | 18 | def test_repr(scalars_dfs): 19 | scalars_df, scalars_pandas_df = scalars_dfs 20 | col_name = "int64_col" 21 | bf_series = scalars_df[col_name] 22 | pd_series = scalars_pandas_df[col_name].astype(pandas.Int64Dtype()) 23 | bf_scalar = bf_series.sum() 24 | pd_scalar = pd_series.sum() 25 | assert repr(bf_scalar) == repr(pd_scalar) 26 | -------------------------------------------------------------------------------- /tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/_config/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/_config/test_compute_options.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import bigframes._config as config 16 | 17 | 18 | def test_default_options(): 19 | options = config.compute_options.ComputeOptions() 20 | 21 | assert options.allow_large_results is None 22 | assert config.options._allow_large_results is False 23 | -------------------------------------------------------------------------------- /tests/unit/_tools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """Tests for helper methods for processing Python objects with minimal dependencies. 16 | 17 | Please keep the dependencies used in this subpackage to a minimum to avoid the 18 | risk of circular dependencies. 19 | """ 20 | -------------------------------------------------------------------------------- /tests/unit/bigquery/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/bigquery/test_json.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import unittest.mock as mock 16 | 17 | import pytest 18 | 19 | import bigframes.bigquery as bbq 20 | import bigframes.pandas as bpd 21 | 22 | 23 | def test_json_set_w_invalid_json_path_value_pairs(): 24 | mock_series = mock.create_autospec(bpd.pandas.Series, instance=True) 25 | with pytest.raises(ValueError, match="Incorrect format"): 26 | bbq.json_set(mock_series, json_path_value_pairs=[("$.a", 1, 100)]) # type: ignore 27 | -------------------------------------------------------------------------------- /tests/unit/core/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/core/compile/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/core/compile/googlesql/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/core/compile/googlesql/test_function.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import bigframes.core.compile.googlesql as sql 16 | 17 | 18 | def test_cast(): 19 | col = sql.ColumnExpression("col") 20 | assert sql.Cast(col, sql.DataType.STRING).sql() == "CAST (`col` AS STRING)" 21 | assert sql.Cast(col, sql.DataType.FLOAT64).sql() == "CAST (`col` AS FLOAT64)" 22 | -------------------------------------------------------------------------------- /tests/unit/core/compile/sqlglot/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/core/compile/sqlglot/snapshots/test_compile_projection/test_compile_projection/out.sql: -------------------------------------------------------------------------------- 1 | WITH `bfcte_0` AS ( 2 | SELECT 3 | *, 4 | `bfcol_0` AS `bfcol_3`, 5 | `bfcol_1` + 1 AS `bfcol_4` 6 | FROM UNNEST(ARRAY>[STRUCT(0, 123456789, 0), STRUCT(1, -987654321, 1), STRUCT(2, 314159, 2), STRUCT(3, CAST(NULL AS INT64), 3), STRUCT(4, -234892, 4), STRUCT(5, 55555, 5), STRUCT(6, 101202303, 6), STRUCT(7, -214748367, 7), STRUCT(8, 2, 8)]) 7 | ) 8 | SELECT 9 | `bfcol_3` AS `rowindex`, 10 | `bfcol_4` AS `int64_col` 11 | FROM `bfcte_0` -------------------------------------------------------------------------------- /tests/unit/core/compile/sqlglot/snapshots/test_compile_readlocal/test_compile_readlocal_w_json_df/out.sql: -------------------------------------------------------------------------------- 1 | WITH `bfcte_0` AS ( 2 | SELECT 3 | * 4 | FROM UNNEST(ARRAY>[STRUCT(PARSE_JSON('null'), 0), STRUCT(PARSE_JSON('true'), 1), STRUCT(PARSE_JSON('100'), 2), STRUCT(PARSE_JSON('0.98'), 3), STRUCT(PARSE_JSON('"a string"'), 4), STRUCT(PARSE_JSON('[]'), 5), STRUCT(PARSE_JSON('[1,2,3]'), 6), STRUCT(PARSE_JSON('[{"a":1},{"a":2},{"a":null},{}]'), 7), STRUCT(PARSE_JSON('"100"'), 8), STRUCT(PARSE_JSON('{"date":"2024-07-16"}'), 9), STRUCT(PARSE_JSON('{"int_value":2,"null_filed":null}'), 10), STRUCT(PARSE_JSON('{"list_data":[10,20,30]}'), 11)]) 5 | ) 6 | SELECT 7 | `bfcol_0` AS `json_col` 8 | FROM `bfcte_0` -------------------------------------------------------------------------------- /tests/unit/core/compile/sqlglot/snapshots/test_compile_readlocal/test_compile_readlocal_w_nested_structs_df/out.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | * 3 | FROM UNNEST(ARRAY>, `bfcol_2` INT64>>[( 4 | 1, 5 | STRUCT( 6 | 'Alice' AS `name`, 7 | 30 AS `age`, 8 | STRUCT('New York' AS `city`, 'USA' AS `country`) AS `address` 9 | ), 10 | 0 11 | ), ( 12 | 2, 13 | STRUCT( 14 | 'Bob' AS `name`, 15 | 25 AS `age`, 16 | STRUCT('London' AS `city`, 'UK' AS `country`) AS `address` 17 | ), 18 | 1 19 | )]) -------------------------------------------------------------------------------- /tests/unit/core/compile/sqlglot/snapshots/test_compile_readlocal/test_compile_readlocal_w_structs_df/out.sql: -------------------------------------------------------------------------------- 1 | WITH `bfcte_0` AS ( 2 | SELECT 3 | * 4 | FROM UNNEST(ARRAY>, `bfcol_2` INT64>>[STRUCT( 5 | 1, 6 | STRUCT( 7 | 'Alice' AS `name`, 8 | 30 AS `age`, 9 | STRUCT('New York' AS `city`, 'USA' AS `country`) AS `address` 10 | ), 11 | 0 12 | ), STRUCT( 13 | 2, 14 | STRUCT( 15 | 'Bob' AS `name`, 16 | 25 AS `age`, 17 | STRUCT('London' AS `city`, 'UK' AS `country`) AS `address` 18 | ), 19 | 1 20 | )]) 21 | ) 22 | SELECT 23 | `bfcol_0` AS `id`, 24 | `bfcol_1` AS `person` 25 | FROM `bfcte_0` -------------------------------------------------------------------------------- /tests/unit/core/compile/sqlglot/test_compile_projection.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import pandas as pd 16 | import pytest 17 | 18 | import bigframes 19 | import bigframes.pandas as bpd 20 | 21 | pytest.importorskip("pytest_snapshot") 22 | 23 | 24 | def test_compile_projection( 25 | scalars_types_pandas_df: pd.DataFrame, compiler_session: bigframes.Session, snapshot 26 | ): 27 | bf_df = bpd.DataFrame( 28 | scalars_types_pandas_df[["int64_col"]], session=compiler_session 29 | ) 30 | bf_df["int64_col"] = bf_df["int64_col"] + 1 31 | snapshot.assert_match(bf_df.sql, "out.sql") 32 | -------------------------------------------------------------------------------- /tests/unit/core/tools/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/functions/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/ml/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/operations/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/session/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/unit/test_constants.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import bigframes_vendored.constants 16 | 17 | import bigframes.version 18 | 19 | 20 | def test_feedback_link_includes_version(): 21 | version = bigframes.version.__version__ 22 | assert len(version) > 0 23 | assert version in bigframes_vendored.constants.FEEDBACK_LINK 24 | -------------------------------------------------------------------------------- /tests/unit/test_notebook.py: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | import os.path 17 | 18 | 19 | def test_template_notebook_exists(): 20 | # This notebook is meant for being used as a BigFrames usage template and 21 | # could be dynamically linked in places such as BQ Studio and IDE extensions. 22 | # Let's make sure it exists in the well known path. 23 | assert os.path.exists("notebooks/getting_started/bq_dataframes_template.ipynb") 24 | -------------------------------------------------------------------------------- /third_party/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/cpython/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/cpython/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/db_benchmark/METADATA: -------------------------------------------------------------------------------- 1 | name: "db-benchmark" 2 | description: 3 | "This repository contains a reproducible benchmarking suite for evaluating " 4 | "database-like operations in single-node environments. It assesses " 5 | "scalability across varying data volumes and complexities." 6 | 7 | third_party { 8 | identifier { 9 | type: "Git" 10 | value: "https://github.com/h2oai/db-benchmark" 11 | primary_source: true 12 | version: "Latest Commit on Main Branch as of Access" 13 | } 14 | version: "Latest Commit on Main Branch as of Access" 15 | last_upgrade_date { year: 2024 month: 7 day: 12 } 16 | license_type: RECIPROCAL 17 | local_modifications: "Modified the queries to test and benchmark the BigFrames project" 18 | } 19 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/db_benchmark/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/db_benchmark/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/db_benchmark/sort_queries.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/duckdblabs/db-benchmark/blob/master/pandas/sort-pandas.py 2 | 3 | import bigframes 4 | import bigframes.session 5 | 6 | 7 | def q1( 8 | project_id: str, dataset_id: str, table_id: str, session: bigframes.Session 9 | ) -> None: 10 | print("Sort benchmark 1: sort by int id2") 11 | 12 | x = session.read_gbq(f"{project_id}.{dataset_id}.{table_id}") 13 | 14 | ans = x.sort_values("id2") 15 | print(ans.shape) 16 | 17 | chk = [ans["v1"].sum()] 18 | print(chk) 19 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/google_cloud_bigquery/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/google_cloud_bigquery/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/google_cloud_bigquery/tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/ibis/backends/bigquery/converter.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/ibis-project/ibis/blob/9.2.0/ibis/backends/bigquery/converter.py 2 | 3 | from __future__ import annotations 4 | 5 | from bigframes_vendored.ibis.formats.pandas import PandasData 6 | 7 | 8 | class BigQueryPandasData(PandasData): 9 | @classmethod 10 | def convert_GeoSpatial(cls, s, dtype, pandas_type): 11 | import geopandas as gpd 12 | import shapely as shp 13 | 14 | return gpd.GeoSeries(shp.from_wkt(s)) 15 | 16 | convert_Point = ( 17 | convert_LineString 18 | ) = ( 19 | convert_Polygon 20 | ) = ( 21 | convert_MultiLineString 22 | ) = convert_MultiPoint = convert_MultiPolygon = convert_GeoSpatial 23 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/ibis/backends/bigquery/udf/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/ibis/backends/bigquery/udf/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/ibis/backends/sql/compilers/__init__.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/ibis-project/ibis/blob/9.2.0/ibis/backends/sql/compilers/__init__.py 2 | 3 | from __future__ import annotations 4 | 5 | __all__ = [ 6 | "BigQueryCompiler", 7 | ] 8 | 9 | from bigframes_vendored.ibis.backends.sql.compilers.bigquery import BigQueryCompiler 10 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/ibis/common/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/ibis/common/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/ibis/common/selectors.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/ibis-project/ibis/blob/9.2.0/ibis/common/selectors.py 2 | 3 | from __future__ import annotations 4 | 5 | import abc 6 | from typing import TYPE_CHECKING 7 | 8 | from bigframes_vendored.ibis.common.grounds import Concrete 9 | 10 | if TYPE_CHECKING: 11 | from collections.abc import Sequence 12 | 13 | import bigframes_vendored.ibis.expr.types as ir 14 | 15 | 16 | class Selector(Concrete): 17 | """A column selector.""" 18 | 19 | @abc.abstractmethod 20 | def expand(self, table: ir.Table) -> Sequence[ir.Value]: 21 | """Expand `table` into value expressions that match the selector. 22 | 23 | Parameters 24 | ---------- 25 | table 26 | An ibis table expression 27 | 28 | Returns 29 | ------- 30 | Sequence[Value] 31 | A sequence of value expressions that match the selector 32 | 33 | """ 34 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/ibis/expr/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/ibis/expr/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/ibis/expr/datatypes/__init__.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/ibis-project/ibis/blob/9.2.0/ibis/expr/datatypes/__init__.py 2 | 3 | from __future__ import annotations 4 | 5 | from bigframes_vendored.ibis.expr.datatypes.cast import * # noqa: F403 6 | from bigframes_vendored.ibis.expr.datatypes.core import * # noqa: F403 7 | from bigframes_vendored.ibis.expr.datatypes.value import * # noqa: F403 8 | 9 | halffloat = float16 # noqa: F405 10 | float = float64 # noqa: F405 11 | double = float64 # noqa: F405 12 | int = int64 # noqa: F405 13 | uint_ = uint64 # noqa: F405 14 | bool = boolean # noqa: F405 15 | str = string # noqa: F405 16 | bytes = binary # noqa: F405 17 | 18 | validate_type = dtype # noqa: F405 19 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/ibis/expr/types/binary.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/ibis-project/ibis/blob/9.2.0/ibis/expr/types/binary.py 2 | 3 | from __future__ import annotations 4 | 5 | from typing import Literal, TYPE_CHECKING 6 | 7 | if TYPE_CHECKING: 8 | from bigframes_vendored.ibis.expr import types as ir 9 | 10 | import bigframes_vendored.ibis.expr.operations as ops 11 | from bigframes_vendored.ibis.expr.types.generic import Column, Scalar, Value 12 | from public import public 13 | 14 | 15 | @public 16 | class BinaryValue(Value): 17 | def hashbytes( 18 | self, 19 | how: Literal["md5", "sha1", "sha256", "sha512"] = "sha256", 20 | ) -> ir.BinaryValue: 21 | """Compute the binary hash value of `arg`. 22 | 23 | Parameters 24 | ---------- 25 | how 26 | Hash algorithm to use 27 | 28 | Returns 29 | ------- 30 | BinaryValue 31 | Binary expression 32 | """ 33 | return ops.HashBytes(self, how).to_expr() 34 | 35 | 36 | @public 37 | class BinaryScalar(Scalar, BinaryValue): 38 | pass 39 | 40 | 41 | @public 42 | class BinaryColumn(Column, BinaryValue): 43 | pass 44 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/ibis/expr/types/typing.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/ibis-project/ibis/blob/9.2.0/ibis/expr/types/typing.py 2 | 3 | from __future__ import annotations 4 | 5 | from collections.abc import Hashable 6 | from typing import TypeVar 7 | 8 | __all__ = ["K", "V"] 9 | 10 | K = TypeVar("K", bound=Hashable) 11 | V = TypeVar("V") 12 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/ibis/expr/types/uuid.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/ibis-project/ibis/blob/9.2.0/ibis/expr/types/uuid.py 2 | 3 | from __future__ import annotations 4 | 5 | from bigframes_vendored.ibis.expr.types.generic import Column, Scalar, Value 6 | from public import public 7 | 8 | 9 | @public 10 | class UUIDValue(Value): 11 | pass 12 | 13 | 14 | @public 15 | class UUIDScalar(Scalar, UUIDValue): 16 | pass 17 | 18 | 19 | @public 20 | class UUIDColumn(Column, UUIDValue): 21 | pass 22 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/pandas/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/core/arrays/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/pandas/core/arrays/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/core/arrays/arrow/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/pandas/core/arrays/arrow/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/core/dtypes/inference.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/pandas-dev/pandas/blob/main/pandas/core/dtypes/inference.py 2 | """ basic inference routines """ 3 | 4 | from __future__ import annotations 5 | 6 | from collections import abc 7 | 8 | 9 | def iterable_not_string(obj) -> bool: 10 | """ 11 | Check if the object is an iterable but not a string. 12 | 13 | Parameters 14 | ---------- 15 | obj : The object to check. 16 | 17 | Returns 18 | ------- 19 | is_iter_not_string : bool 20 | Whether `obj` is a non-string iterable. 21 | 22 | Examples 23 | -------- 24 | >>> iterable_not_string([1, 2, 3]) 25 | True 26 | >>> iterable_not_string("foo") 27 | False 28 | >>> iterable_not_string(1) 29 | False 30 | """ 31 | return isinstance(obj, abc.Iterable) and not isinstance(obj, str) 32 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/core/indexes/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/pandas/core/indexes/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/core/reshape/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/pandas/core/reshape/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/core/tools/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/pandas/core/tools/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/core/window/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/pandas/core/window/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/io/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/pandas/io/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/io/parsers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/pandas/io/parsers/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/pandas/util/_exceptions.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/pandas-dev/pandas/blob/main/pandas/util/_exceptions.py 2 | from __future__ import annotations 3 | 4 | import inspect 5 | import os 6 | 7 | 8 | def find_stack_level() -> int: 9 | """ 10 | Find the first place in the stack that is not inside pandas 11 | (tests notwithstanding). 12 | """ 13 | 14 | import pandas as pd 15 | 16 | pkg_dir = os.path.dirname(pd.__file__) 17 | test_dir = os.path.join(pkg_dir, "tests") 18 | 19 | # https://stackoverflow.com/questions/17407119/python-inspect-stack-is-slow 20 | frame = inspect.currentframe() 21 | n = 0 22 | while frame: 23 | fname = inspect.getfile(frame) 24 | if fname.startswith(pkg_dir) and not fname.startswith(test_dir): 25 | frame = frame.f_back 26 | n += 1 27 | else: 28 | break 29 | return n 30 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/py.typed -------------------------------------------------------------------------------- /third_party/bigframes_vendored/sklearn/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/sklearn/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/sklearn/ensemble/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/sklearn/ensemble/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Ritchie Vink 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/METADATA: -------------------------------------------------------------------------------- 1 | name: "polars-tpch" 2 | description: 3 | "This repository contains modified TPC-H benchmark queries that are " 4 | "specifically adapted to evaluate the performance of the BigFrames library. " 5 | "These benchmarks are designed to test complex data processing workflows " 6 | "that are typical in decision support systems." 7 | 8 | third_party { 9 | identifier { 10 | type: "Git" 11 | value: "https://github.com/pola-rs/tpch" 12 | primary_source: true 13 | version: "Latest Commit on Main Branch as of Access" 14 | } 15 | version: "Latest Commit on Main Branch as of Access" 16 | last_upgrade_date { year: 2024 month: 7 day: 12 } 17 | license_type: PERMISSIVE 18 | local_modifications: "Modified the queries to test and benchmark the BigFrames project" 19 | } 20 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/tpch/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/queries/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/tpch/queries/__init__.py -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/queries/q6.py: -------------------------------------------------------------------------------- 1 | # Contains code from https://github.com/pola-rs/tpch/blob/main/queries/pandas/q6.py 2 | 3 | from datetime import date 4 | 5 | import bigframes 6 | 7 | 8 | def q(project_id: str, dataset_id: str, session: bigframes.Session): 9 | lineitem = session.read_gbq( 10 | f"{project_id}.{dataset_id}.LINEITEM", 11 | index_col=bigframes.enums.DefaultIndexKind.NULL, 12 | ) 13 | 14 | var1 = date(1994, 1, 1) 15 | var2 = date(1995, 1, 1) 16 | var3 = 0.05 17 | var4 = 0.07 18 | var5 = 24 19 | 20 | filt = lineitem[(lineitem["L_SHIPDATE"] >= var1) & (lineitem["L_SHIPDATE"] < var2)] 21 | filt = filt[(filt["L_DISCOUNT"] >= var3) & (filt["L_DISCOUNT"] <= var4)] 22 | filt = filt[filt["L_QUANTITY"] < var5] 23 | result_df = ( 24 | (filt["L_EXTENDEDPRICE"] * filt["L_DISCOUNT"]) 25 | .agg(["sum"]) 26 | .rename("REVENUE") 27 | .to_frame() 28 | ) 29 | 30 | next(result_df.to_pandas_batches(max_results=1500)) 31 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q1.sql: -------------------------------------------------------------------------------- 1 | select 2 | l_returnflag, 3 | l_linestatus, 4 | sum(l_quantity) as sum_qty, 5 | sum(l_extendedprice) as sum_base_price, 6 | sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, 7 | sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, 8 | avg(l_quantity) as avg_qty, 9 | avg(l_extendedprice) as avg_price, 10 | avg(l_discount) as avg_disc, 11 | count(*) as count_order 12 | from 13 | {line_item_ds} 14 | where 15 | l_shipdate <= '1998-09-02' 16 | group by 17 | l_returnflag, 18 | l_linestatus 19 | order by 20 | l_returnflag, 21 | l_linestatus 22 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q10.sql: -------------------------------------------------------------------------------- 1 | select 2 | c_custkey, 3 | c_name, 4 | round(sum(l_extendedprice * (1 - l_discount)), 2) as revenue, 5 | c_acctbal, 6 | n_name, 7 | c_address, 8 | c_phone, 9 | c_comment 10 | from 11 | {customer_ds}, 12 | {orders_ds}, 13 | {line_item_ds}, 14 | {nation_ds} 15 | where 16 | c_custkey = o_custkey 17 | and l_orderkey = o_orderkey 18 | and o_orderdate >= date '1993-10-01' 19 | and o_orderdate < date '1993-10-01' + interval '3' month 20 | and l_returnflag = 'R' 21 | and c_nationkey = n_nationkey 22 | group by 23 | c_custkey, 24 | c_name, 25 | c_acctbal, 26 | c_phone, 27 | n_name, 28 | c_address, 29 | c_comment 30 | order by 31 | revenue desc 32 | limit 20 33 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q11.sql: -------------------------------------------------------------------------------- 1 | select 2 | ps_partkey, 3 | round(sum(ps_supplycost * ps_availqty), 2) as value 4 | from 5 | {part_supp_ds}, 6 | {supplier_ds}, 7 | {nation_ds} 8 | where 9 | ps_suppkey = s_suppkey 10 | and s_nationkey = n_nationkey 11 | and n_name = 'GERMANY' 12 | group by 13 | ps_partkey having 14 | sum(ps_supplycost * ps_availqty) > ( 15 | select 16 | sum(ps_supplycost * ps_availqty) * 0.0001 17 | from 18 | {part_supp_ds}, 19 | {supplier_ds}, 20 | {nation_ds} 21 | where 22 | ps_suppkey = s_suppkey 23 | and s_nationkey = n_nationkey 24 | and n_name = 'GERMANY' 25 | ) 26 | order by 27 | value desc 28 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q12.sql: -------------------------------------------------------------------------------- 1 | select 2 | l_shipmode, 3 | sum(case 4 | when o_orderpriority = '1-URGENT' 5 | or o_orderpriority = '2-HIGH' 6 | then 1 7 | else 0 8 | end) as high_line_count, 9 | sum(case 10 | when o_orderpriority <> '1-URGENT' 11 | and o_orderpriority <> '2-HIGH' 12 | then 1 13 | else 0 14 | end) as low_line_count 15 | from 16 | {orders_ds}, 17 | {line_item_ds} 18 | where 19 | o_orderkey = l_orderkey 20 | and l_shipmode in ('MAIL', 'SHIP') 21 | and l_commitdate < l_receiptdate 22 | and l_shipdate < l_commitdate 23 | and l_receiptdate >= date '1994-01-01' 24 | and l_receiptdate < date '1994-01-01' + interval '1' year 25 | group by 26 | l_shipmode 27 | order by 28 | l_shipmode 29 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q13.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | c_count, COUNT(*) AS custdist 3 | FROM ( 4 | SELECT 5 | c_custkey, 6 | COUNT(o_orderkey) AS c_count 7 | FROM 8 | {customer_ds} LEFT OUTER JOIN {orders_ds} ON 9 | c_custkey = o_custkey 10 | AND o_comment NOT LIKE '%special%requests%' 11 | GROUP BY 12 | c_custkey 13 | ) AS c_orders 14 | GROUP BY 15 | c_count 16 | ORDER BY 17 | custdist DESC, 18 | c_count DESC 19 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q14.sql: -------------------------------------------------------------------------------- 1 | select 2 | round(100.00 * sum(case 3 | when p_type like 'PROMO%' 4 | then l_extendedprice * (1 - l_discount) 5 | else 0 6 | end) / sum(l_extendedprice * (1 - l_discount)), 2) as promo_revenue 7 | from 8 | {line_item_ds}, 9 | {part_ds} 10 | where 11 | l_partkey = p_partkey 12 | and l_shipdate >= date '1995-09-01' 13 | and l_shipdate < date '1995-09-01' + interval '1' month 14 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q15.sql: -------------------------------------------------------------------------------- 1 | WITH revenue AS ( 2 | SELECT 3 | l_suppkey AS supplier_no, 4 | SUM(l_extendedprice * (1 - l_discount)) AS total_revenue 5 | FROM 6 | {line_item_ds} 7 | WHERE 8 | l_shipdate >= DATE '1996-01-01' 9 | AND l_shipdate < DATE '1996-01-01' + INTERVAL '3' month 10 | GROUP BY 11 | l_suppkey 12 | ) 13 | SELECT 14 | s.s_suppkey, 15 | s.s_name, 16 | s.s_address, 17 | s.s_phone, 18 | r.total_revenue 19 | FROM 20 | {supplier_ds} s 21 | JOIN 22 | revenue r ON s.s_suppkey = r.supplier_no 23 | WHERE 24 | r.total_revenue = (SELECT MAX(total_revenue) FROM revenue) 25 | ORDER BY 26 | s.s_suppkey; 27 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q16.sql: -------------------------------------------------------------------------------- 1 | select 2 | p_brand, 3 | p_type, 4 | p_size, 5 | count(distinct ps_suppkey) as supplier_cnt 6 | from 7 | {part_supp_ds}, 8 | {part_ds} 9 | where 10 | p_partkey = ps_partkey 11 | and p_brand <> 'Brand#45' 12 | and p_type not like 'MEDIUM POLISHED%' 13 | and p_size in (49, 14, 23, 45, 19, 3, 36, 9) 14 | and ps_suppkey not in ( 15 | select 16 | s_suppkey 17 | from 18 | {supplier_ds} 19 | where 20 | s_comment like '%Customer%Complaints%' 21 | ) 22 | group by 23 | p_brand, 24 | p_type, 25 | p_size 26 | order by 27 | supplier_cnt desc, 28 | p_brand, 29 | p_type, 30 | p_size 31 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q17.sql: -------------------------------------------------------------------------------- 1 | select 2 | round(sum(l_extendedprice) / 7.0, 2) as avg_yearly 3 | from 4 | {line_item_ds}, 5 | {part_ds} 6 | where 7 | p_partkey = l_partkey 8 | and p_brand = 'Brand#23' 9 | and p_container = 'MED BOX' 10 | and l_quantity < ( 11 | select 12 | 0.2 * avg(l_quantity) 13 | from 14 | {line_item_ds} 15 | where 16 | l_partkey = p_partkey 17 | ) 18 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q18.sql: -------------------------------------------------------------------------------- 1 | select 2 | c_name, 3 | c_custkey, 4 | o_orderkey, 5 | o_orderdate as o_orderdat, 6 | o_totalprice, 7 | sum(l_quantity) as col6 8 | from 9 | {customer_ds}, 10 | {orders_ds}, 11 | {line_item_ds} 12 | where 13 | o_orderkey in ( 14 | select 15 | l_orderkey 16 | from 17 | {line_item_ds} 18 | group by 19 | l_orderkey having 20 | sum(l_quantity) > 300 21 | ) 22 | and c_custkey = o_custkey 23 | and o_orderkey = l_orderkey 24 | group by 25 | c_name, 26 | c_custkey, 27 | o_orderkey, 28 | o_orderdate, 29 | o_totalprice 30 | order by 31 | o_totalprice desc, 32 | o_orderdate 33 | limit 100 34 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q2.sql: -------------------------------------------------------------------------------- 1 | select 2 | s_acctbal, 3 | s_name, 4 | n_name, 5 | p_partkey, 6 | p_mfgr, 7 | s_address, 8 | s_phone, 9 | s_comment 10 | from 11 | {part_ds}, 12 | {supplier_ds}, 13 | {part_supp_ds}, 14 | {nation_ds}, 15 | {region_ds} 16 | where 17 | p_partkey = ps_partkey 18 | and s_suppkey = ps_suppkey 19 | and p_size = 15 20 | and p_type like '%BRASS' 21 | and s_nationkey = n_nationkey 22 | and n_regionkey = r_regionkey 23 | and r_name = 'EUROPE' 24 | and ps_supplycost = ( 25 | select 26 | min(ps_supplycost) 27 | from 28 | {part_supp_ds}, 29 | {supplier_ds}, 30 | {nation_ds}, 31 | {region_ds} 32 | where 33 | p_partkey = ps_partkey 34 | and s_suppkey = ps_suppkey 35 | and s_nationkey = n_nationkey 36 | and n_regionkey = r_regionkey 37 | and r_name = 'EUROPE' 38 | ) 39 | order by 40 | s_acctbal desc, 41 | n_name, 42 | s_name, 43 | p_partkey 44 | limit 100 45 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q20.sql: -------------------------------------------------------------------------------- 1 | select 2 | s_name, 3 | s_address 4 | from 5 | {supplier_ds}, 6 | {nation_ds} 7 | where 8 | s_suppkey in ( 9 | select 10 | ps_suppkey 11 | from 12 | {part_supp_ds} 13 | where 14 | ps_partkey in ( 15 | select 16 | p_partkey 17 | from 18 | {part_ds} 19 | where 20 | p_name like 'forest%' 21 | ) 22 | and ps_availqty > ( 23 | select 24 | 0.5 * sum(l_quantity) 25 | from 26 | {line_item_ds} 27 | where 28 | l_partkey = ps_partkey 29 | and l_suppkey = ps_suppkey 30 | and l_shipdate >= date '1994-01-01' 31 | and l_shipdate < date '1994-01-01' + interval '1' year 32 | ) 33 | ) 34 | and s_nationkey = n_nationkey 35 | and n_name = 'CANADA' 36 | order by 37 | s_name 38 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q21.sql: -------------------------------------------------------------------------------- 1 | select 2 | s_name, 3 | count(*) as numwait 4 | from 5 | {supplier_ds}, 6 | {line_item_ds} l1, 7 | {orders_ds}, 8 | {nation_ds} 9 | where 10 | s_suppkey = l1.l_suppkey 11 | and o_orderkey = l1.l_orderkey 12 | and o_orderstatus = 'F' 13 | and l1.l_receiptdate > l1.l_commitdate 14 | and exists ( 15 | select 16 | * 17 | from 18 | {line_item_ds} l2 19 | where 20 | l2.l_orderkey = l1.l_orderkey 21 | and l2.l_suppkey <> l1.l_suppkey 22 | ) 23 | and not exists ( 24 | select 25 | * 26 | from 27 | {line_item_ds} l3 28 | where 29 | l3.l_orderkey = l1.l_orderkey 30 | and l3.l_suppkey <> l1.l_suppkey 31 | and l3.l_receiptdate > l3.l_commitdate 32 | ) 33 | and s_nationkey = n_nationkey 34 | and n_name = 'SAUDI ARABIA' 35 | group by 36 | s_name 37 | order by 38 | numwait desc, 39 | s_name 40 | limit 100 41 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q22.sql: -------------------------------------------------------------------------------- 1 | select 2 | cntrycode, 3 | count(*) as numcust, 4 | sum(c_acctbal) as totacctbal 5 | from ( 6 | select 7 | SUBSTR(c_phone, 1, 2) AS cntrycode, 8 | c_acctbal 9 | from 10 | {customer_ds} 11 | where 12 | SUBSTR(c_phone, 1, 2) in 13 | ('13', '31', '23', '29', '30', '18', '17') 14 | and c_acctbal > ( 15 | select 16 | avg(c_acctbal) 17 | from 18 | {customer_ds} 19 | where 20 | c_acctbal > 0.00 21 | and SUBSTR(c_phone, 1, 2) in 22 | ('13', '31', '23', '29', '30', '18', '17') 23 | ) 24 | and not exists ( 25 | select 26 | * 27 | from 28 | {orders_ds} 29 | where 30 | o_custkey = c_custkey 31 | ) 32 | ) as custsale 33 | group by 34 | cntrycode 35 | order by 36 | cntrycode 37 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q3.sql: -------------------------------------------------------------------------------- 1 | select 2 | l_orderkey, 3 | sum(l_extendedprice * (1 - l_discount)) as revenue, 4 | o_orderdate, 5 | o_shippriority 6 | from 7 | {customer_ds}, 8 | {orders_ds}, 9 | {line_item_ds} 10 | where 11 | c_mktsegment = 'BUILDING' 12 | and c_custkey = o_custkey 13 | and l_orderkey = o_orderkey 14 | and o_orderdate < '1995-03-15' 15 | and l_shipdate > '1995-03-15' 16 | group by 17 | l_orderkey, 18 | o_orderdate, 19 | o_shippriority 20 | order by 21 | revenue desc, 22 | o_orderdate 23 | limit 10 24 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q4.sql: -------------------------------------------------------------------------------- 1 | select 2 | o_orderpriority, 3 | count(*) as order_count 4 | from 5 | {orders_ds} 6 | where 7 | o_orderdate >= date '1993-07-01' 8 | and o_orderdate < date '1993-10-01' 9 | and exists ( 10 | select 11 | * 12 | from 13 | {line_item_ds} 14 | where 15 | l_orderkey = o_orderkey 16 | and l_commitdate < l_receiptdate 17 | ) 18 | group by 19 | o_orderpriority 20 | order by 21 | o_orderpriority 22 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q5.sql: -------------------------------------------------------------------------------- 1 | select 2 | n_name, 3 | sum(l_extendedprice * (1 - l_discount)) as revenue 4 | from 5 | {customer_ds}, 6 | {orders_ds}, 7 | {line_item_ds}, 8 | {supplier_ds}, 9 | {nation_ds}, 10 | {region_ds} 11 | where 12 | c_custkey = o_custkey 13 | and l_orderkey = o_orderkey 14 | and l_suppkey = s_suppkey 15 | and c_nationkey = s_nationkey 16 | and s_nationkey = n_nationkey 17 | and n_regionkey = r_regionkey 18 | and r_name = 'ASIA' 19 | and o_orderdate >= date '1994-01-01' 20 | and o_orderdate < date '1995-01-01' 21 | group by 22 | n_name 23 | order by 24 | revenue desc 25 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q6.sql: -------------------------------------------------------------------------------- 1 | select 2 | sum(l_extendedprice * l_discount) as revenue 3 | from 4 | {line_item_ds} 5 | where 6 | l_shipdate >= date '1994-01-01' 7 | and l_shipdate < date '1994-01-01' + interval '1' year 8 | and l_discount between .05 and .07 9 | and l_quantity < 24 10 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/tpch/sql_queries/q9.sql: -------------------------------------------------------------------------------- 1 | select 2 | nation, 3 | o_year, 4 | round(sum(amount), 2) as sum_profit 5 | from 6 | ( 7 | select 8 | n_name as nation, 9 | EXTRACT(YEAR FROM o_orderdate) as o_year, 10 | l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount 11 | from 12 | {part_ds}, 13 | {supplier_ds}, 14 | {line_item_ds}, 15 | {part_supp_ds}, 16 | {orders_ds}, 17 | {nation_ds} 18 | where 19 | s_suppkey = l_suppkey 20 | and ps_suppkey = l_suppkey 21 | and ps_partkey = l_partkey 22 | and p_partkey = l_partkey 23 | and o_orderkey = l_orderkey 24 | and s_nationkey = n_nationkey 25 | and p_name like '%green%' 26 | ) as profit 27 | group by 28 | nation, 29 | o_year 30 | order by 31 | nation, 32 | o_year desc 33 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/version.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | __version__ = "2.5.0" 16 | 17 | # {x-release-please-start-date} 18 | __release_date__ = "2025-05-30" 19 | # {x-release-please-end} 20 | -------------------------------------------------------------------------------- /third_party/bigframes_vendored/xgboost/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/python-bigquery-dataframes/0b59cf1008613770fa1433c6da395e755c86fe22/third_party/bigframes_vendored/xgboost/__init__.py --------------------------------------------------------------------------------