diff --git a/bigframes/constants.py b/bigframes/constants.py index 4778eb9c9e..9591297956 100644 --- a/bigframes/constants.py +++ b/bigframes/constants.py @@ -12,19 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. -import datetime - """Constants used across BigQuery DataFrames. This module should not depend on any others in the package. """ -FEEDBACK_LINK = ( - "Share your usecase with the BigQuery DataFrames team at the " - "https://bit.ly/bigframes-feedback survey." -) +import datetime + +import bigframes_vendored.constants -ABSTRACT_METHOD_ERROR_MESSAGE = f"Abstract method. You have likely encountered a bug. Please share this stacktrace and how you reached it with the BigQuery DataFrames team. {FEEDBACK_LINK}" +FEEDBACK_LINK = bigframes_vendored.constants.FEEDBACK_LINK +ABSTRACT_METHOD_ERROR_MESSAGE = ( + bigframes_vendored.constants.ABSTRACT_METHOD_ERROR_MESSAGE +) DEFAULT_EXPIRATION = datetime.timedelta(days=7) diff --git a/bigframes/pandas/__init__.py b/bigframes/pandas/__init__.py index dc9b847a9b..603f6678a5 100644 --- a/bigframes/pandas/__init__.py +++ b/bigframes/pandas/__init__.py @@ -652,8 +652,8 @@ def read_parquet( def remote_function( - input_types: Union[type, Sequence[type]], - output_type: type, + input_types: Union[None, type, Sequence[type]] = None, + output_type: Optional[type] = None, dataset: Optional[str] = None, bigquery_connection: Optional[str] = None, reuse: bool = True, diff --git a/bigframes/session/__init__.py b/bigframes/session/__init__.py index 07bb6ddce0..c953087b3e 100644 --- a/bigframes/session/__init__.py +++ b/bigframes/session/__init__.py @@ -1549,8 +1549,8 @@ def _ibis_to_temp_table( def remote_function( self, - input_types: Union[type, Sequence[type]], - output_type: type, + input_types: Union[None, type, Sequence[type]] = None, + output_type: Optional[type] = None, dataset: Optional[str] = None, bigquery_connection: Optional[str] = None, reuse: bool = True, diff --git a/third_party/bigframes_vendored/constants.py b/third_party/bigframes_vendored/constants.py new file mode 100644 index 0000000000..0d4a7d1df6 --- /dev/null +++ b/third_party/bigframes_vendored/constants.py @@ -0,0 +1,29 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Constants used across BigQuery DataFrames and bigframes_vendored. + +This module should not depend on any others in the package. +""" + +FEEDBACK_LINK = ( + "Share your usecase with the BigQuery DataFrames team at the " + "https://bit.ly/bigframes-feedback survey." +) + +ABSTRACT_METHOD_ERROR_MESSAGE = ( + "Abstract method. You have likely encountered a bug. " + "Please share this stacktrace and how you reached it with the BigQuery DataFrames team. " + f"{FEEDBACK_LINK}" +) diff --git a/third_party/bigframes_vendored/pandas/core/frame.py b/third_party/bigframes_vendored/pandas/core/frame.py index 7d2e3b2cec..ba222fc8c3 100644 --- a/third_party/bigframes_vendored/pandas/core/frame.py +++ b/third_party/bigframes_vendored/pandas/core/frame.py @@ -13,12 +13,11 @@ from typing import Hashable, Iterable, Literal, Mapping, Optional, Sequence, Union +from bigframes_vendored import constants import bigframes_vendored.pandas.core.generic as generic import numpy as np import pandas as pd -from bigframes import constants - # ----------------------------------------------------------------------- # DataFrame class diff --git a/third_party/bigframes_vendored/pandas/core/generic.py b/third_party/bigframes_vendored/pandas/core/generic.py index 54c876ef3c..95302e51b2 100644 --- a/third_party/bigframes_vendored/pandas/core/generic.py +++ b/third_party/bigframes_vendored/pandas/core/generic.py @@ -3,11 +3,10 @@ from typing import Callable, Iterator, Literal, Optional, TYPE_CHECKING +import bigframes_vendored.constants as constants from bigframes_vendored.pandas.core import indexing import bigframes_vendored.pandas.core.common as common -import bigframes.constants as constants - if TYPE_CHECKING: from bigframes_vendored.pandas.pandas._typing import T diff --git a/third_party/bigframes_vendored/pandas/core/indexing.py b/third_party/bigframes_vendored/pandas/core/indexing.py index 3c7f8a6c9f..a188c7197e 100644 --- a/third_party/bigframes_vendored/pandas/core/indexing.py +++ b/third_party/bigframes_vendored/pandas/core/indexing.py @@ -1,6 +1,6 @@ # Contains code from https://github.com/pandas-dev/pandas/blob/main/pandas/core/indexing.py -import bigframes.constants as constants +import bigframes_vendored.constants as constants class IndexingMixin: