@@ -593,7 +593,7 @@ def flatten(
593593 def bit_count (
594594 self ,
595595 * ,
596- session : Optional [bigframes . session .Session ] = None ,
596+ session : Optional [session .Session ] = None ,
597597 ) -> S :
598598 """The input, `expression`, must be an integer or `BYTES`. Returns the number of bits that are set in the input expression. For signed integers, this is the number of bits in two's complement form."""
599599 from bigframes .operations .googlesql .global_namespace .bit import (
@@ -764,26 +764,26 @@ def date(
764764 self ,
765765 time_zone_expression : Union [
766766 series .Series ,
767- bigframes . core . col .Expression ,
767+ col .Expression ,
768768 Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], str ],
769769 ] = sentinels .Sentinel .ARGUMENT_DEFAULT ,
770770 year : Union [
771771 series .Series ,
772- bigframes . core . col .Expression ,
772+ col .Expression ,
773773 Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], int ],
774774 ] = sentinels .Sentinel .ARGUMENT_DEFAULT ,
775775 month : Union [
776776 series .Series ,
777- bigframes . core . col .Expression ,
777+ col .Expression ,
778778 Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], int ],
779779 ] = sentinels .Sentinel .ARGUMENT_DEFAULT ,
780780 day : Union [
781781 series .Series ,
782- bigframes . core . col .Expression ,
782+ col .Expression ,
783783 Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], int ],
784784 ] = sentinels .Sentinel .ARGUMENT_DEFAULT ,
785785 * ,
786- session : Optional [bigframes . session .Session ] = None ,
786+ session : Optional [session .Session ] = None ,
787787 ) -> S :
788788 """Constructs or extracts a date."""
789789 from bigframes .operations .googlesql .global_namespace .date import (
@@ -792,7 +792,7 @@ def date(
792792
793793 # Resolve session from other arguments if not passed
794794 if session is None :
795- import bigframes .core . googlesql as googlesql
795+ from bigframes .core import googlesql
796796
797797 session = googlesql ._find_session (
798798 time_zone_expression ,
@@ -815,16 +815,16 @@ def date_add(
815815 self ,
816816 int64_expression : Union [
817817 series .Series ,
818- bigframes . core . col .Expression ,
818+ col .Expression ,
819819 Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], int ],
820820 ],
821821 date_part : Union [
822822 series .Series ,
823- bigframes . core . col .Expression ,
823+ col .Expression ,
824824 Union [Any , Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ]],
825825 ],
826826 * ,
827- session : Optional [bigframes . session .Session ] = None ,
827+ session : Optional [session .Session ] = None ,
828828 ) -> S :
829829 """Adds a specified time interval to a DATE."""
830830 from bigframes .operations .googlesql .global_namespace .date import (
@@ -833,7 +833,7 @@ def date_add(
833833
834834 # Resolve session from other arguments if not passed
835835 if session is None :
836- import bigframes .core . googlesql as googlesql
836+ from bigframes .core import googlesql
837837
838838 session = googlesql ._find_session (
839839 int64_expression ,
@@ -848,57 +848,20 @@ def date_add(
848848 )
849849 return self ._to_series (cast (series .Series , result ))
850850
851- def date_bucket (
852- self ,
853- bucket_width : Union [
854- series .Series ,
855- bigframes .core .col .Expression ,
856- Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], datetime .timedelta ],
857- ],
858- bucket_origin : Union [
859- series .Series ,
860- bigframes .core .col .Expression ,
861- Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], datetime .date ],
862- ] = sentinels .Sentinel .ARGUMENT_DEFAULT ,
863- * ,
864- session : Optional [bigframes .session .Session ] = None ,
865- ) -> S :
866- """Gets the lower bound of the date bucket that contains a date."""
867- from bigframes .operations .googlesql .global_namespace .date import (
868- date_bucket as date_bucket_impl ,
869- )
870-
871- # Resolve session from other arguments if not passed
872- if session is None :
873- import bigframes .core .googlesql as googlesql
874-
875- session = googlesql ._find_session (
876- bucket_width ,
877- bucket_origin ,
878- )
879-
880- bf_series = self ._bf_from_series (session )
881- result = date_bucket_impl (
882- bf_series ,
883- bucket_width ,
884- bucket_origin ,
885- )
886- return self ._to_series (cast (series .Series , result ))
887-
888851 def date_diff (
889852 self ,
890853 start_date : Union [
891854 series .Series ,
892- bigframes . core . col .Expression ,
855+ col .Expression ,
893856 Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], datetime .date ],
894857 ],
895858 granularity : Union [
896859 series .Series ,
897- bigframes . core . col .Expression ,
860+ col .Expression ,
898861 Union [Any , Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ]],
899862 ],
900863 * ,
901- session : Optional [bigframes . session .Session ] = None ,
864+ session : Optional [session .Session ] = None ,
902865 ) -> S :
903866 """Gets the number of unit boundaries between two DATE values (end_date - start_date) at a particular time granularity."""
904867 from bigframes .operations .googlesql .global_namespace .date import (
@@ -907,7 +870,7 @@ def date_diff(
907870
908871 # Resolve session from other arguments if not passed
909872 if session is None :
910- import bigframes .core . googlesql as googlesql
873+ from bigframes .core import googlesql
911874
912875 session = googlesql ._find_session (
913876 start_date ,
@@ -925,7 +888,7 @@ def date_diff(
925888 def date_from_unix_date (
926889 self ,
927890 * ,
928- session : Optional [bigframes . session .Session ] = None ,
891+ session : Optional [session .Session ] = None ,
929892 ) -> S :
930893 """Interprets an INT64 expression as the number of days since 1970-01-01."""
931894 from bigframes .operations .googlesql .global_namespace .date import (
@@ -942,16 +905,16 @@ def date_sub(
942905 self ,
943906 int64_expression : Union [
944907 series .Series ,
945- bigframes . core . col .Expression ,
908+ col .Expression ,
946909 Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], int ],
947910 ],
948911 date_part : Union [
949912 series .Series ,
950- bigframes . core . col .Expression ,
913+ col .Expression ,
951914 Union [Any , Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ]],
952915 ],
953916 * ,
954- session : Optional [bigframes . session .Session ] = None ,
917+ session : Optional [session .Session ] = None ,
955918 ) -> S :
956919 """Subtracts a specified time interval from a DATE."""
957920 from bigframes .operations .googlesql .global_namespace .date import (
@@ -960,7 +923,7 @@ def date_sub(
960923
961924 # Resolve session from other arguments if not passed
962925 if session is None :
963- import bigframes .core . googlesql as googlesql
926+ from bigframes .core import googlesql
964927
965928 session = googlesql ._find_session (
966929 int64_expression ,
@@ -979,11 +942,11 @@ def date_trunc(
979942 self ,
980943 granularity : Union [
981944 series .Series ,
982- bigframes . core . col .Expression ,
945+ col .Expression ,
983946 Union [Any , Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ]],
984947 ],
985948 * ,
986- session : Optional [bigframes . session .Session ] = None ,
949+ session : Optional [session .Session ] = None ,
987950 ) -> S :
988951 """Truncates a DATE, DATETIME, or TIMESTAMP value at a particular granularity."""
989952 from bigframes .operations .googlesql .global_namespace .date import (
@@ -992,7 +955,7 @@ def date_trunc(
992955
993956 # Resolve session from other arguments if not passed
994957 if session is None :
995- import bigframes .core . googlesql as googlesql
958+ from bigframes .core import googlesql
996959
997960 session = googlesql ._find_session (
998961 granularity ,
@@ -1009,16 +972,16 @@ def extract(
1009972 self ,
1010973 part : Union [
1011974 series .Series ,
1012- bigframes . core . col .Expression ,
975+ col .Expression ,
1013976 Union [Any , Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ]],
1014977 ],
1015978 time_zone : Union [
1016979 series .Series ,
1017- bigframes . core . col .Expression ,
980+ col .Expression ,
1018981 Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], str ],
1019982 ] = sentinels .Sentinel .ARGUMENT_DEFAULT ,
1020983 * ,
1021- session : Optional [bigframes . session .Session ] = None ,
984+ session : Optional [session .Session ] = None ,
1022985 ) -> S :
1023986 """Returns the value corresponding to the specified date part."""
1024987 from bigframes .operations .googlesql .global_namespace .date import (
@@ -1027,7 +990,7 @@ def extract(
1027990
1028991 # Resolve session from other arguments if not passed
1029992 if session is None :
1030- import bigframes .core . googlesql as googlesql
993+ from bigframes .core import googlesql
1031994
1032995 session = googlesql ._find_session (
1033996 part ,
@@ -1046,11 +1009,11 @@ def format_date(
10461009 self ,
10471010 format_string : Union [
10481011 series .Series ,
1049- bigframes . core . col .Expression ,
1012+ col .Expression ,
10501013 Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], str ],
10511014 ],
10521015 * ,
1053- session : Optional [bigframes . session .Session ] = None ,
1016+ session : Optional [session .Session ] = None ,
10541017 ) -> S :
10551018 """Formats a DATE value according to a specified format string."""
10561019 from bigframes .operations .googlesql .global_namespace .date import (
@@ -1059,7 +1022,7 @@ def format_date(
10591022
10601023 # Resolve session from other arguments if not passed
10611024 if session is None :
1062- import bigframes .core . googlesql as googlesql
1025+ from bigframes .core import googlesql
10631026
10641027 session = googlesql ._find_session (
10651028 format_string ,
@@ -1076,11 +1039,11 @@ def last_day(
10761039 self ,
10771040 date_part : Union [
10781041 series .Series ,
1079- bigframes . core . col .Expression ,
1042+ col .Expression ,
10801043 Union [Any , Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ]],
10811044 ] = sentinels .Sentinel .ARGUMENT_DEFAULT ,
10821045 * ,
1083- session : Optional [bigframes . session .Session ] = None ,
1046+ session : Optional [session .Session ] = None ,
10841047 ) -> S :
10851048 """Returns the last day from a date expression. This is commonly used to return the last day of the month."""
10861049 from bigframes .operations .googlesql .global_namespace .date import (
@@ -1089,7 +1052,7 @@ def last_day(
10891052
10901053 # Resolve session from other arguments if not passed
10911054 if session is None :
1092- import bigframes .core . googlesql as googlesql
1055+ from bigframes .core import googlesql
10931056
10941057 session = googlesql ._find_session (
10951058 date_part ,
@@ -1106,11 +1069,11 @@ def parse_date(
11061069 self ,
11071070 format_string : Union [
11081071 series .Series ,
1109- bigframes . core . col .Expression ,
1072+ col .Expression ,
11101073 Union [Literal [sentinels .Sentinel .ARGUMENT_DEFAULT ], str ],
11111074 ],
11121075 * ,
1113- session : Optional [bigframes . session .Session ] = None ,
1076+ session : Optional [session .Session ] = None ,
11141077 ) -> S :
11151078 """Converts a STRING value to a DATE value."""
11161079 from bigframes .operations .googlesql .global_namespace .date import (
@@ -1119,7 +1082,7 @@ def parse_date(
11191082
11201083 # Resolve session from other arguments if not passed
11211084 if session is None :
1122- import bigframes .core . googlesql as googlesql
1085+ from bigframes .core import googlesql
11231086
11241087 session = googlesql ._find_session (
11251088 format_string ,
@@ -1135,7 +1098,7 @@ def parse_date(
11351098 def unix_date (
11361099 self ,
11371100 * ,
1138- session : Optional [bigframes . session .Session ] = None ,
1101+ session : Optional [session .Session ] = None ,
11391102 ) -> S :
11401103 """Returns the number of days since 1970-01-01."""
11411104 from bigframes .operations .googlesql .global_namespace .date import (
0 commit comments