-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Calling SQLSpec.load_sql_files() with a path to a single .sql file raises SQLFileNotFoundError. The underlying error is NotADirectoryError: [Errno 20] Not a directory: '/path/to/hello.sql/.'.
URL to code causing the issue
No response
MCVE
import tempfile
from pathlib import Path
from sqlspec import SQLSpec
# Write a sample SQL file into a temp directory
with tempfile.TemporaryDirectory() as tmpdir:
sql_file = Path(tmpdir) / "hello.sql"
sql_file.write_text("-- name: hello_world\nselect 'Hello, World!' as greeting;\n")
sqlspec = SQLSpec()
# Both of these fail:
# Option 1: load a single file
sqlspec.load_sql_files(str(sql_file))
# Option 2: load from the directory
# sqlspec.load_sql_files(tmpdir)
print(sqlspec.get_sql("hello_world"))Steps to reproduce
See reproduction above.Screenshots
N/A
Logs
Package Version
0.40.0
Platform
- Linux
- Mac
- Windows
- Other (Please specify in the description above)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working