Skip to main content

LangChain integration for Sail — a Rust-based drop-in replacement for Spark

Project description

langchain-sail

LangChain integration for Sail, a drop-in replacement for Apache Spark.

Installation

pip install langchain-sail

To run a local Sail server for development/testing:

pip install pysail

Usage

from pysail.spark import SparkConnectServer
from pyspark.sql import SparkSession
from langchain_sail import SailSQL, SailSQLToolkit, create_sail_sql_agent

# Start a local Sail server
server = SparkConnectServer()
server.start()
_, port = server.listening_address

# Connect via SailSQL
spark = SparkSession.builder.remote(f"sc://localhost:{port}").getOrCreate()
sail = SailSQL(spark_session=spark)

# Use with an LLM agent
from langchain_anthropic import ChatAnthropic

llm = ChatAnthropic(model="claude-sonnet-4-6")
toolkit = SailSQLToolkit(db=sail, llm=llm)
agent = create_sail_sql_agent(llm=llm, toolkit=toolkit, verbose=True)

result = agent.invoke({"input": "What tables are available?"})
print(result["output"])

What is Sail?

Sail is a drop-in replacement for Apache Spark, written in Rust. It uses the Spark Connect protocol, so existing PySpark code works out of the box — just point your SparkSession at a Sail server instead of a Spark cluster.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_sail-0.2.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_sail-0.2.0-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file langchain_sail-0.2.0.tar.gz.

File metadata

  • Download URL: langchain_sail-0.2.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langchain_sail-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ce2549eb9978821f62e1881c3eed834c72aee299112b28786a00ef73e3c8dd40
MD5 b2dd87bb5bf3dda7701a66bc45c2c9fc
BLAKE2b-256 de1b500114977633075c318d8e2821046231cb1060172e78d1ac7d33db4eb966

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_sail-0.2.0.tar.gz:

Publisher: release.yml on lakehq/langchain-sail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_sail-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: langchain_sail-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langchain_sail-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a7cf02104cff0523dee29ace909a82353e434afcbd3ea8080cca047a322d6c6
MD5 b3ff98bc8b2004ce67c676dd60e81250
BLAKE2b-256 c2a7bc51462c3be085eb58e61c1cf42e44bd34d1da74964ea0995b73b23e258c

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_sail-0.2.0-py3-none-any.whl:

Publisher: release.yml on lakehq/langchain-sail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page