Skip to content

Commit d0b9d5a

Browse files
committed
refactor(x): remove XTweetFileIngestionConfiguration and related pipeline batch size doc
- Removed XTweetFileIngestionConfiguration class and its references - Updated batch_size docstring in XFileIngestionPipelineConfiguration for clarity This cleans up unused ingestion configuration and improves documentation clarity.
1 parent 99e4df9 commit d0b9d5a

2 files changed

Lines changed: 2 additions & 70 deletions

File tree

libs/naas-abi-marketplace/naas_abi_marketplace/applications/x/__init__.py

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -112,73 +112,6 @@ class XTweetSearchWorkflowConfiguration(BaseModel):
112112
)
113113

114114

115-
class XTweetFileIngestionConfiguration(BaseModel):
116-
"""One configured drop-folder that the XOrchestration polls for tweet
117-
dataset files. Each entry produces its own Dagster job + sensor pair:
118-
the sensor lists *input_prefix* in object storage every
119-
``interval_seconds``, and any object that hasn't already been ingested
120-
(sha256-based dedupe in the graph) triggers a run that streams the
121-
file through :class:`XFileIngestionPipeline`.
122-
123-
Designed for large datasets — the pipeline never buffers the whole
124-
file in memory; NDJSON is read line by line and JSON arrays are
125-
incrementally parsed via ijson, so a 12 GB dump uses constant memory.
126-
"""
127-
128-
name: str = Field(
129-
description=(
130-
"Short identifier (letters/digits/underscores) used to name "
131-
"the generated Dagster job and sensor."
132-
)
133-
)
134-
input_prefix: str = Field(
135-
default="x/uploads",
136-
description=(
137-
"Object-storage prefix to watch. Drop tweet dump files under "
138-
"this prefix and the sensor will pick them up on its next "
139-
"tick. Accepted shapes (auto-detected): "
140-
"(a) one big JSON array of bare tweet dicts — same as the "
141-
"files that XIntegration.search_recent_tweets's cache writes "
142-
"to ``<datastore_path>/search_recent_tweets/<hash>.json``, so "
143-
"point this at that directory to back-fill from the cache; "
144-
"(b) one X v2 ``{data:[...], meta:{...}}`` response — what "
145-
"you'd get if you piped the API output to a file; "
146-
"(c) JSONL of either shape — one tweet per line, or one "
147-
"response envelope per line. ``.gz`` variants also work."
148-
),
149-
)
150-
interval_seconds: int = Field(
151-
default=60,
152-
ge=30,
153-
description="Minimum delay between two sensor evaluations.",
154-
)
155-
batch_size: int = Field(
156-
default=500,
157-
ge=10,
158-
le=10_000,
159-
description=(
160-
"Number of tweet records to accumulate before flushing as one "
161-
"SPARQL INSERT into the named graph. Larger = fewer round "
162-
"trips but more memory; smaller = lower memory ceiling."
163-
),
164-
)
165-
recursive: bool = Field(
166-
default=False,
167-
description=(
168-
"If True, also pick up files in sub-prefixes under "
169-
"input_prefix. Default off to mirror DocumentOrchestration."
170-
),
171-
)
172-
delete_after_ingest: bool = Field(
173-
default=False,
174-
description=(
175-
"If True, delete the source object once ingestion succeeds. "
176-
"Off by default so re-running stays a no-op (sha256 dedupe) "
177-
"and the operator can inspect the original."
178-
),
179-
)
180-
181-
182115
class ABIModule(BaseModule):
183116
dependencies: ModuleDependencies = ModuleDependencies(
184117
modules=[
@@ -231,7 +164,6 @@ class Configuration(ModuleConfiguration):
231164
ontology_namespace: str = "http://ontology.naas.ai/x/"
232165
graph_name: str = "http://ontology.naas.ai/graph/x"
233166
search_recent_tweets_workflow: list[XTweetSearchWorkflowConfiguration] = []
234-
file_ingestion_pipeline: list[XTweetFileIngestionConfiguration] = []
235167

236168
# on_initialized is called by the engine after all modules and services have been fully loaded.
237169
# At this point, you can safely access other modules and services through the engine's interfaces.

libs/naas-abi-marketplace/naas_abi_marketplace/applications/x/pipelines/XFileIngestionPipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ class XFileIngestionPipelineConfiguration(PipelineConfiguration):
100100
:meth:`get_object_stream` (added to the port in this PR).
101101
triple_store: Target named graph + dedupe ASK destination.
102102
graph_name: Named graph IRI to insert into.
103-
batch_size: Records per INSERT round trip — see
104-
:class:`naas_abi_marketplace.applications.x.XTweetFileIngestionConfiguration`.
103+
batch_size: Records per INSERT round trip. Larger = fewer round trips
104+
but more memory; smaller = lower memory ceiling.
105105
"""
106106

107107
object_storage: IObjectStorageDomain

0 commit comments

Comments
 (0)