Commit 6a280fd
committed
fix(date): import pandas locally in make_ts_exclusive
make_ts_exclusive uses pd.Timedelta in its tsql branch, but pandas is
only imported under TYPE_CHECKING (pandas is banned as a module-level
import). Unlike its siblings make_inclusive_end and to_utc_timestamp, it
never imports pandas at runtime, so make_ts_exclusive(time, dialect="tsql")
raises NameError: name 'pd' is not defined.
This is reachable when rendering an INCREMENTAL_BY_TIME_RANGE model with a
jinja source/ref event-time filter on the tsql dialect (renderer.py), which
surfaces as a ConfigError that the model could not be rendered.
Add a local `import pandas as pd` inside make_ts_exclusive, mirroring the
existing runtime-pandas helpers, and add a regression test covering both the
tsql and non-tsql paths.
Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>1 parent b0bc176 commit 6a280fd
2 files changed
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
344 | 344 | | |
345 | 345 | | |
346 | 346 | | |
| 347 | + | |
| 348 | + | |
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
144 | 157 | | |
145 | 158 | | |
146 | 159 | | |
| |||
0 commit comments