fix: Trying to import pyspark lazily to avoid the dependency on the library by lokeshrangineni · Pull Request #4091 · feast-dev/feast
from pyspark.sql import SparkSession
from feast import flags_helper from feast.data_source import DataSource from feast.errors import DataSourceNoNameException, DataSourceNotFoundException
def get_table_query_string(self) -> str: """Returns a string that can directly be used to reference this table in SQL""" try: from pyspark.sql import SparkSession except ImportError as e: from feast.errors import FeastExtrasDependencyImportError
raise FeastExtrasDependencyImportError("spark", str(e))
if self.table: # Backticks make sure that spark sql knows this a table reference. table = ".".join([f"`{x}`" for x in self.table.split(".")])