You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def __getattr__(name):
if name == "SparkAPI":
try:
from splink.spark.database_api import SparkAPI
return SparkAPI
except ImportError:
raise ImportError(
"SparkAPI cannot be imported because its dependencies are not "
"installed. Please `pip install pyspark`."
)
raise AttributeError(f"module 'splink' has no attribute '{name}'")
If you want a custom error message that is generated at the point the user tries to from splink import SparkAPI
Otherwise the user would just get ImportError: cannot import name 'SparkAPI' from 'splink'
If
__init__.py
contains:We could then write
The text was updated successfully, but these errors were encountered: