# TODO: Remove this once CLI can run independent of PySpark.
try:
    import pyspark
except ImportError:
    raise Exception(
        "PySpark is not available, please install tecton with the [pyspark] extra (e.g. 'tecton[pyspark]==<VERSION NUMBER>')"
    )

#  When adding/removing a class here, also mirror them to sdk/docs/index.rst,
#  or they won't be included in the autogenerated docs.
# nopycln: file
# noreorder
from tecton_spark import conf
from tecton.feature_services.logging_config import LoggingConfig
from tecton.interactive.data_source import get_data_source
from tecton.data_sources.data_source import BatchDataSource
from tecton.data_sources.data_source import StreamDataSource
from tecton.data_sources.datetime_partition_column import DatetimePartitionColumn
from tecton.entities.entity import Entity  # noqa: F401
from tecton_spark.online_serving_index import OnlineServingIndex
from tecton.interactive.entity import get_entity
from tecton.features_common.feature_configs import (
    ExistingClusterConfig,
    FeatureAggregation,
    DeltaConfig,
    ParquetConfig,
    MonitoringConfig,
    DatabricksClusterConfig,
    EMRClusterConfig,
    RedisConfig,
    DynamoConfig,
)
from tecton.feature_services.feature_service import FeatureService, FeaturesConfig
from tecton.interactive.feature_table import get_feature_table  # noqa: F401
from tecton.interactive.feature_view import get_feature_view  # noqa: F401
from tecton.interactive.feature_service import get_feature_service  # noqa: F401
from tecton.interactive.transformation import get_transformation  # noqa: F401
from tecton.interactive.data_frame import DataFrame, FeatureVector  # noqa: F401
from tecton.interactive.workspace import Workspace, get_workspace  # noqa: F401
from tecton.interactive.feature_retrieval import get_historical_features, get_online_features  # noqa: F401
from tecton.interactive.feature_freshness import get_feature_freshness
from tecton_spark.function_serialization import inlined

from tecton_spark.materialization_context import materialization_context
from tecton import version as __version_lib
from tecton.data_sources.hive_data_source import HiveDSConfig
from tecton.data_sources.kafka_data_source import KafkaDSConfig
from tecton.data_sources.kinesis_data_source import KinesisDSConfig
from tecton.data_sources.file_data_source import FileDSConfig
from tecton.data_sources.redshift_data_source import RedshiftDSConfig
from tecton.data_sources.snowflake_data_source import SnowflakeDSConfig
from tecton.interactive.dataset import get_dataset
from tecton.credentials_override import set_credentials
from tecton.fco_listers import (
    list_entities,
    list_transformations,
    list_feature_services,
    list_workspaces,
    list_feature_views,
    list_datasets,
    list_data_sources,
    list_feature_tables,
)
from tecton.legacy_tecton_objects import (
    sql_transformation,
    pyspark_transformation,
    online_transformation,
    DataSourceConfig,
    VirtualDataSource,
    TemporalFeaturePackage,
    TemporalAggregateFeaturePackage,
    OnlineFeaturePackage,
    PushFeaturePackage,
    MaterializationConfig,
    NewEMRClusterConfig,
    NewDatabricksClusterConfig,
)
from tecton_spark.pipeline_helper import RequestDataSource
from tecton.transformations.const import const
from tecton.transformations.transformation import transformation
from tecton.transformations.transformation import SPARK_SQL_MODE
from tecton.transformations.transformation import PYSPARK_MODE
from tecton.transformations.transformation import PANDAS_MODE
from tecton.feature_table.feature_table import FeatureTable
from tecton.feature_views.feature_view import Input

# Import `batch_feature_view` from alpha if Snowflake is enabled.
if conf.get_or_none("ALPHA_SNOWFLAKE_COMPUTE_ENABLED"):
    from tecton._alpha import batch_feature_view
else:
    from tecton.feature_views.feature_view import batch_feature_view
    from tecton.feature_views.feature_view import batch_window_aggregate_feature_view

from tecton.feature_views.feature_view import stream_feature_view
from tecton.feature_views.feature_view import stream_window_aggregate_feature_view
from tecton.feature_views.feature_view import on_demand_feature_view
from tecton.feature_views.feature_view import INPUT_WINDOW_UNBOUNDED_PRECEDING
from tecton.feature_views.feature_view import BackfillConfig
from tecton_spark.time_utils import WINDOW_UNBOUNDED_PRECEDING
from tecton_spark.udfs import tecton_sliding_window_udf
from tecton.transformations.builtin_transformations import tecton_sliding_window

__version__ = __version_lib.get_version()
