Skip to content

Conversation

@chelsea-lin
Copy link
Contributor

Fixes internal issue 446726636 🦕

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Oct 24, 2025
@chelsea-lin chelsea-lin force-pushed the main_chelsealin_temporal branch from 636578e to a7fe5c6 Compare October 24, 2025 23:20
@chelsea-lin chelsea-lin requested a review from sycai October 24, 2025 23:28
@chelsea-lin chelsea-lin marked this pull request as ready for review October 24, 2025 23:28
@chelsea-lin chelsea-lin requested review from a team as code owners October 24, 2025 23:28
@chelsea-lin chelsea-lin added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 27, 2025
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 27, 2025

# Helpers
def dayofweek_op_impl(expr: TypedExpr) -> sge.Expression:
# Adjust the 1-based day-of-week index (from SQL) to a 0-based index.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment does not seem to be relevant any more. Remove it?

extract_expr = sge.Extract(
this=sge.Identifier(this="DAYOFWEEK"), expression=expr.expr
)
return sge.Cast(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a comment above line 68, explaining that:

  • The SQL function returns values in the range [1,7] with Sunday as the first day of of the week.
  • pandas assumed the week starts on Monday, which is denoted by 0 and ends on Sunday which is denoted by 6

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good points. Fixed.

@chelsea-lin chelsea-lin force-pushed the main_chelsealin_temporal branch from a7fe5c6 to ee7be9a Compare October 27, 2025 22:06
@chelsea-lin chelsea-lin enabled auto-merge (squash) October 27, 2025 22:16
@chelsea-lin chelsea-lin disabled auto-merge October 27, 2025 22:41
@chelsea-lin chelsea-lin enabled auto-merge (squash) October 27, 2025 22:41
@chelsea-lin chelsea-lin merged commit 3e6299f into main Oct 27, 2025
20 of 25 checks passed
@chelsea-lin chelsea-lin deleted the main_chelsealin_temporal branch October 27, 2025 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants