diff --git a/examples/s3_ingest.py b/examples/s3_ingest.py index c3301c24b..4ae7e8488 100644 --- a/examples/s3_ingest.py +++ b/examples/s3_ingest.py @@ -3,7 +3,6 @@ import pyarrow.fs import os -# Usage: poetry run python s3_ingest.py s3:// [s3://another-thing ...] # ruff: noqa: E402 sys.path.append("../lib/sycamore") @@ -19,6 +18,10 @@ from simple_config import idx_settings, osrch_args, title_template +if len(sys.argv) <= 1 or sys.argv[1] == "-h" or sys.argv[1] == "--help": + print("Usage: poetry run python s3_ingest.py s3:// [s3://another-thing ...]") + exit(1) + index = "demoindex0" if "AWS_SECRET_ACCESS_KEY" in os.environ: diff --git a/lib/sycamore/sycamore/executor.py b/lib/sycamore/sycamore/executor.py index 5c5363b2f..f1fdc2536 100644 --- a/lib/sycamore/sycamore/executor.py +++ b/lib/sycamore/sycamore/executor.py @@ -139,14 +139,12 @@ def recursive_execute(self, n: Node) -> list[Document]: from sycamore.materialize import Materialize def get_name(f): - try: + if hasattr(f, "_name"): return f._name # handle the case of basemap transforms - except AttributeError: - pass - try: + + if hasattr(f, "__name__"): return f.__name__ - except AttributeError: - pass + return f.__class__.__name__ if len(n.children) == 0: