Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/bigframes/bigframes/_config/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import pydata_google_auth

import bigframes._config.bigquery_options as bigquery_options
from bigframes._config import options

_SCOPES = ["https://www.googleapis.com/auth/cloud-platform"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import bigframes_vendored.constants as constants

import bigframes.core.groupby as groupby
import bigframes.operations as ops
import bigframes.operations.aggregations as agg_ops
import bigframes.series as series

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def googlesql_scalar_op_impl(
)
arg_spec = op.args[-1]
if isinstance(operand.op(), ibis_generic.OmittedArg):
assert arg_spec.optional, f"Argument omitted, but not optional"
assert arg_spec.optional, "Argument omitted, but not optional"
continue

target_idx = len(final_operands)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _(*operands: TypedExpr, op: ops.GoogleSqlScalarOp) -> sge.Expression:
)
arg_spec = op.args[-1]
if operand.is_omitted:
assert arg_spec.optional, f"Argument omitted, but not optional"
assert arg_spec.optional, "Argument omitted, but not optional"
continue
elif arg_spec.arg_name:
args.append(sge.Kwarg(this=arg_spec.arg_name, expression=operand.expr))
Expand Down
1 change: 0 additions & 1 deletion packages/bigframes/bigframes/core/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
from bigframes.core.ordering import OrderingExpression, RowOrdering

if typing.TYPE_CHECKING:
import bigframes.core.ordering as orderings
import bigframes.session


Expand Down
1 change: 1 addition & 0 deletions packages/bigframes/bigframes/operations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@
"GeoStDistanceOp",
"GeoStLengthOp",
"GeoStRegionStatsOp",
"GeoStSimplifyOp",
# AI ops
"AIClassify",
"AIGenerate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@

import dataclasses
import typing
from enum import Enum, auto
from typing import Callable, Iterable

import bigframes.operations as ops
import bigframes.operations.type as op_typing
from bigframes import dtypes


Expand Down
6 changes: 1 addition & 5 deletions packages/bigframes/bigframes/operations/googlesql/aead.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@

from __future__ import annotations

import datetime
import decimal
from typing import Any, Literal, Optional, TypeVar, Union
from typing import Literal, Union

import bigframes.core.col
import bigframes.core.expression as ex
import bigframes.core.googlesql
import bigframes.core.sentinels as sentinels
import bigframes.operations as ops
import bigframes.series as series
from bigframes import dtypes
from bigframes.operations import googlesql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@

from __future__ import annotations

import datetime
import decimal
from typing import Any, Literal, Optional, TypeVar, Union
from typing import Literal, Union

import bigframes.core.col
import bigframes.core.expression as ex
import bigframes.core.googlesql
import bigframes.core.sentinels as sentinels
import bigframes.operations as ops
import bigframes.series as series
from bigframes import dtypes
from bigframes.operations import googlesql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@

from __future__ import annotations

import datetime
import decimal
from typing import Any, Literal, Optional, TypeVar, Union
from typing import Any, Literal, Union

import bigframes.core.col
import bigframes.core.expression as ex
import bigframes.core.googlesql
import bigframes.core.sentinels as sentinels
import bigframes.operations as ops
import bigframes.series as series
from bigframes import dtypes
from bigframes.operations import googlesql
Expand Down Expand Up @@ -301,7 +298,6 @@ def _ARRAY_TO_STRING_SIG(*args):
# Pad args with None to match max expected args
args = args + (None,) * (3 - len(args))
# Try matching impl 0
any1_val = None
match_ok = True
if match_ok and args[0] is not None:
if not dtypes.is_array_like(args[0]):
Expand Down Expand Up @@ -338,7 +334,6 @@ def _ARRAY_TO_STRING_SIG(*args):
return dtypes.STRING_DTYPE

# Try matching impl 1
any1_val = None
match_ok = True
if match_ok and args[0] is not None:
if not dtypes.is_array_like(args[0]):
Expand Down Expand Up @@ -432,7 +427,6 @@ def _GENERATE_ARRAY_SIG(*args):
# Pad args with None to match max expected args
args = args + (None,) * (3 - len(args))
# Try matching impl 0
any1_val = None
match_ok = True
if match_ok and args[0] is not None:
try:
Expand All @@ -456,7 +450,6 @@ def _GENERATE_ARRAY_SIG(*args):
return dtypes.list_type(dtypes.INT_DTYPE)

# Try matching impl 1
any1_val = None
match_ok = True
if match_ok and args[0] is not None:
try:
Expand Down Expand Up @@ -489,7 +482,6 @@ def _GENERATE_ARRAY_SIG(*args):
return dtypes.list_type(dtypes.NUMERIC_DTYPE)

# Try matching impl 2
any1_val = None
match_ok = True
if match_ok and args[0] is not None:
try:
Expand Down
5 changes: 2 additions & 3 deletions packages/bigframes/bigframes/session/bq_caching_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import dataclasses
import math
import threading
from typing import Literal, Mapping, Optional, Sequence, Tuple
from typing import Literal, Optional, Sequence, Tuple

import google.api_core.exceptions
import google.cloud.bigquery_storage_v1
Expand All @@ -41,8 +41,7 @@
import bigframes.session.metrics
import bigframes.session.planner
import bigframes.session.temporary_storage
from bigframes._config import ComputeOptions
from bigframes.core import bq_data, compile, guid, identifiers, local_data, rewrite
from bigframes.core import compile, guid, identifiers, local_data, rewrite
from bigframes.core.compile.sqlglot import sql as sg_sql
from bigframes.core.compile.sqlglot import sqlglot_ir
from bigframes.session import (
Expand Down
2 changes: 0 additions & 2 deletions packages/bigframes/bigframes/session/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@

"""Clients manages the connection to Google APIs."""

import os
import threading
import typing
from typing import Optional, Sequence, Tuple

import google.api_core.client_info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from __future__ import annotations

import asyncio
from typing import Callable, Literal, Mapping, Optional, Tuple
from typing import Literal, Mapping, Optional, Tuple

import google.api_core.exceptions
import google.cloud.bigquery.job as bq_job
Expand All @@ -24,15 +24,12 @@

import bigframes
import bigframes.core.compile
import bigframes.core.compile.ibis_compiler.ibis_compiler as ibis_compiler
import bigframes.core.compile.sqlglot.compiler as sqlglot_compiler
import bigframes.core.events
import bigframes.core.schema as schemata
import bigframes.session._io.bigquery as bq_io
import bigframes.session.metrics
from bigframes import exceptions as bfe
from bigframes.core import bq_data, compile, nodes
from bigframes.core.compile.configs import CompileRequest, CompileResult
from bigframes.core.compile.configs import CompileRequest
from bigframes.session import execution_spec, executor, semi_executor

_WRITE_DISPOSITIONS = {
Expand Down
2 changes: 1 addition & 1 deletion packages/bigframes/bigframes/session/execution_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from __future__ import annotations

import dataclasses
from typing import TYPE_CHECKING, Literal, Mapping, Optional, Union
from typing import Literal, Mapping, Optional, Union

from google.cloud import bigquery

Expand Down
4 changes: 1 addition & 3 deletions packages/bigframes/bigframes/session/proxy_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@

from __future__ import annotations

import typing
import uuid
import warnings
from typing import Mapping, Optional
from typing import Optional

import google.cloud.bigquery as bigquery
import google.cloud.exceptions
Expand All @@ -30,7 +29,6 @@
execution_spec,
executor,
loader,
metrics,
temporary_storage,
)

Expand Down
4 changes: 2 additions & 2 deletions packages/bigframes/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def lint(session):
"ruff",
"check",
"--select",
"I",
"I,F",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88", # Standard Black line length
*LINT_PATHS,
Expand Down Expand Up @@ -201,7 +201,7 @@ def format(session):
"ruff",
"check",
"--select",
"I",
"I,F",
"--fix",
f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
"--line-length=88", # Standard Black line length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import json

import geopandas as gpd # type: ignore
import pandas as pd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def bq_engine(
bigquery_client: bigquery.Client,
bigquery_storage_read_client: google.cloud.bigquery_storage_v1.BigQueryReadClient,
):
publisher = events.Publisher()
return direct_gbq_execution.DirectGbqExecutor(
bigquery_client,
bqstoragereadclient=bigquery_storage_read_client,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@
from bigframes.core import (
agg_expressions,
array_value,
events,
expression,
identifiers,
nodes,
)
from bigframes.session import direct_gbq_execution, polars_executor
from bigframes.session import polars_executor
from bigframes.testing.engine_utils import assert_equivalence_execution

pytest.importorskip("polars")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import re

import pytest

import bigframes.dtypes
import bigframes.operations.googlesql as gsql_ops
from bigframes.core import array_value, expression
from bigframes.core import array_value
from bigframes.session import polars_executor
from bigframes.testing.engine_utils import assert_equivalence_execution

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@
# limitations under the License.

import pytest
from google.cloud import bigquery

import bigframes.operations.aggregations as agg_ops
from bigframes.core import (
agg_expressions,
array_value,
events,
expression,
identifiers,
nodes,
window_spec,
)
from bigframes.session import direct_gbq_execution, polars_executor
from bigframes.session import polars_executor
from bigframes.testing.engine_utils import assert_equivalence_execution

pytest.importorskip("polars")
Expand Down
4 changes: 0 additions & 4 deletions packages/bigframes/tests/unit/core/sql/test_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
import pytest

import bigframes.bigquery as bbq
import bigframes.core.col as col
import bigframes.core.expression as ex
import bigframes.core.sql.ml
import bigframes.dtypes as dtypes
import bigframes.operations.numeric_ops as numeric_ops

pytest.importorskip("pytest_snapshot")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@

import google.cloud.bigquery as bigquery
import google.cloud.exceptions
import pyarrow as pa
import pytest

import bigframes
import bigframes.core.nodes as nodes
import bigframes.core.schema as schemata
from bigframes.session.proxy_executor import DualCompilerProxyExecutor


Expand Down
1 change: 0 additions & 1 deletion packages/bigframes/tests/unit/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import inspect
import re
import sys
import unittest.mock as mock

import pandas as pd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import bigframes_vendored.ibis.expr.datashape as ds
import bigframes_vendored.ibis.expr.datatypes as dt
import bigframes_vendored.ibis.expr.operations as ops
from bigframes_vendored import ibis
from bigframes_vendored.ibis import util
from bigframes_vendored.ibis.common.annotations import annotated
from bigframes_vendored.ibis.common.temporal import IntervalUnit
Expand Down
Loading