You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@hamilton.apache.org by "shetty13 (via GitHub)" <gi...@apache.org> on 2026/04/04 10:07:07 UTC

[I] polars_col_stats.zeros does not catch NotImplementedError for temporal types on Polars >= 1.32 [hamilton]

shetty13 opened a new issue, #1540:
URL: https://github.com/apache/hamilton/issues/1540

   **Short description**
   
   `polars_col_stats.zeros` does not catch `NotImplementedError` raised by Polars >= 1.32 for temporal types, causing DataFrame assets to render as blank pages in Hamilton UI.
   
   # Current behavior
   
   When tracking a Polars DataFrame containing `Date` or `Datetime` columns, the `zeros` function calls `col.eq(0)` which raises `NotImplementedError` on Polars >= 1.32. This exception is uncaught, so `_compute_stats` falls back to `base_data_type: "unknown-polars"`. The UI frontend's `splitColumnsByObjectType` does not handle this type and crashes with a blank page.
   
   ## Stack Traces
   
   ```
   NotImplementedError: Series of type Date does not have eq operator
   
     File "hamilton_sdk/tracking/polars_col_stats.py", line 28, in zeros
       result = col.eq(0)
     File "polars/series/series.py", line 1042, in eq
       return self.__eq__(other)
     File "polars/series/series.py", line 952, in __eq__
       return self._comp(other, "eq")
     File "polars/series/series.py", line 936, in _comp
       raise NotImplementedError(msg)
   ```
   
   Frontend console error:
   ```
   TypeError: Cannot read properties of undefined (reading 'push')
       at DAGWorksDescribe.tsx:412 (splitColumnsByObjectType)
   ```
   
   ## Steps to replicate behavior
   
   1. Track a Polars DataFrame with a `Date` or `Datetime` column using `HamiltonTracker`
   2. Run the pipeline with Polars >= 1.32
   3. Open Hamilton UI and click "View" on the DataFrame output node
   4. Page renders blank
   
   ## Library & System Information
   
   - `sf-hamilton`: 1.89.0
   - `sf-hamilton-sdk`: 0.8.0
   - `polars`: 1.39.3
   - `dagworks/ui-backend`: 0.0.17
   - `dagworks/ui-frontend`: 0.0.17
   - Python 3.13, Linux
   
   # Expected behavior
   
   Temporal columns should be identified as `base_data_type: "datetime"` and render correctly in the UI. Adding `NotImplementedError` to the except clause in `zeros` fixes the issue:
   
   ```python
   def zeros(col: pl.Series) -> int:
       try:
           result = col.eq(0)
       except TypeError:
           return 0
       except ValueError:
           # e.g. comparing datetime
           return 0
       except NotImplementedError:
           # polars >= 1.32 raises this for temporal types
           return 0
       if str(result) == "NotImplemented":
           return 0
       return result.sum()
   ```
   
   # Additional context
   
   This worked on Polars 1.31.0. Starting from ~1.32, `.eq()` on temporal Series raises `NotImplementedError` instead of `TypeError`/`ValueError` (see [polars#25729](https://github.com/pola-rs/polars/issues/25729)). The Hamilton SDK does not pin a Polars version, so this affects anyone using a recent Polars release.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@hamilton.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] polars_col_stats.zeros does not catch NotImplementedError for temporal types on Polars >= 1.32 [hamilton]

Posted by "shetty13 (via GitHub)" <gi...@apache.org>.
shetty13 closed issue #1540: polars_col_stats.zeros does not catch NotImplementedError for temporal types on Polars >= 1.32
URL: https://github.com/apache/hamilton/issues/1540


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@hamilton.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] polars_col_stats.zeros does not catch NotImplementedError for temporal types on Polars >= 1.32 [hamilton]

Posted by "shetty13 (via GitHub)" <gi...@apache.org>.
shetty13 commented on issue #1540:
URL: https://github.com/apache/hamilton/issues/1540#issuecomment-4186920010

   My bad, this has already been addressed in [4203b4da](https://github.com/apache/hamilton/commit/4203b4daf8a09048b57499bb33200342bb5bc9dc) ("Various Unit Test Fixes [#1429](https://github.com/apache/hamilton/pull/1429)"). Awaiting a new release of sf-hamilton-sdk on PyPI that includes this fix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@hamilton.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org