Skip to content
Merged
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
11 changes: 7 additions & 4 deletions packages/bigframes/bigframes/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -2280,11 +2280,14 @@ def mask(self, cond, other=None) -> Series:
return self.where(~cond, other)

def to_frame(self, name: blocks.Label = None) -> bigframes.dataframe.DataFrame:
provided_name = name if name else self.name
provided_name = name if name is not None else self.name
# To be consistent with Pandas, it assigns 0 as the column name if missing. 0 is the first element of RangeIndex.
block = self._block.with_column_labels(
[provided_name] if provided_name else [0]
)
column_names: List[blocks.Label]
if provided_name is None or pandas.isna([cast(Any, provided_name)])[0]:
column_names = [0]
else:
column_names = [provided_name]
block = self._block.with_column_labels(column_names)
return bigframes.dataframe.DataFrame(block)

def to_csv(
Expand Down
Loading