Skip to content

Commit

Permalink
Add temporary workaround for SPARK-48710
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev-iL committed Aug 9, 2024
1 parent 7ce97a3 commit 6b14e47
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hamilton/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import importlib
import logging
from typing import Any, Dict, Optional, Type
from unittest.mock import patch

import numpy as np

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -78,7 +81,9 @@ def load_extension(plugin_module: str):
:param plugin_module: the module name sans .py. e.g. pandas, polars, pyspark_pandas.
"""
mod = importlib.import_module(f"hamilton.plugins.{plugin_module}_extensions")
with patch.object(np, "NaN", np.nan):
# Workaround for https://issues.apache.org/jira/browse/SPARK-48710
mod = importlib.import_module(f"hamilton.plugins.{plugin_module}_extensions")
# We have various plugin extensions. We default to assuming it's a dataframe extension with columns,
# unless it explicitly says it's not.
# We need to check the following if we are to enable `@extract_columns` for example.
Expand Down

0 comments on commit 6b14e47

Please sign in to comment.