Skip to content

Commit 3a24dce

Browse files
boxplotincclaude
andcommitted
Fix day unit calculation so N=1 means yesterday, consistent with M/Y logic
Previously N=1 subtracted 1 day from yesterday (giving the day before yesterday), which was inconsistent with month/year where N=1 means the current period. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 36d2d60 commit 3a24dce

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎Incrementally Refresh Dataflow.ipynb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -911,9 +911,9 @@
911911
" return None\n",
912912
"\n",
913913
" if unit == 'D':\n",
914-
" # Days: subtract N days from yesterday\n",
915-
" result = yesterday - timedelta(days=n)\n",
916-
" self.logger.info(f\"Calculated start date: {result} (yesterday - {n} days)\")\n",
914+
" # Days: subtract (N-1) days from yesterday so N=1 means yesterday,\n # consistent with month/year logic where N=1 means the current period.\n",
915+
" result = yesterday - timedelta(days=n - 1)\n",
916+
" self.logger.info(f\"Calculated start date: {result} (yesterday - {n - 1} days)\")\n",
917917
" elif unit == 'M':\n",
918918
" # Months: start of (current month - (N-1) months)\n",
919919
" # N=1 means current month, N=2 means previous month, etc.\n",

0 commit comments

Comments
 (0)