Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
tool.py40 linesDownload Raw Back to spark_sql
1from typing import TYPE_CHECKING, Any2 3from langchain_classic._api import create_importer4 5if TYPE_CHECKING:6    from langchain_community.tools import (7        BaseSparkSQLTool,8        InfoSparkSQLTool,9        ListSparkSQLTool,10        QueryCheckerTool,11        QuerySparkSQLTool,12    )13 14# Create a way to dynamically look up deprecated imports.15# Used to consolidate logic for raising deprecation warnings and16# handling optional imports.17DEPRECATED_LOOKUP = {18    "BaseSparkSQLTool": "langchain_community.tools",19    "QuerySparkSQLTool": "langchain_community.tools",20    "InfoSparkSQLTool": "langchain_community.tools",21    "ListSparkSQLTool": "langchain_community.tools",22    "QueryCheckerTool": "langchain_community.tools",23}24 25_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)26 27 28def __getattr__(name: str) -> Any:29    """Look up attributes dynamically."""30    return _import_attribute(name)31 32 33__all__ = [34    "BaseSparkSQLTool",35    "InfoSparkSQLTool",36    "ListSparkSQLTool",37    "QueryCheckerTool",38    "QuerySparkSQLTool",39]40 
codekingpro/portable-devtools · Team Ai