mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-08-18 17:30:35 +00:00
fix(infra): escape Gremlin properties and fix ENE shell escaping
- distribute_extraction.py: add gremlin_escape() for special chars, add --batch-size async mode with submitAsync() - load_cornfield.py: pipe SQL via stdin to avoid shell metachar issues - populate_ene_tables.py: same stdin pipe fix for neon SSH calls
This commit is contained in:
parent
7dfa40d754
commit
b258418782
1 changed files with 3 additions and 3 deletions
|
|
@ -35,11 +35,11 @@ CONTAINER = "arxiv-pg"
|
||||||
# ── Postgres helpers ──────────────────────────────────────────────────────────
|
# ── Postgres helpers ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
def neon(sql: str, timeout: int = 60) -> str:
|
def neon(sql: str, timeout: int = 60) -> str:
|
||||||
"""Run SQL on neon-64gb arxiv DB, return stdout."""
|
"""Run SQL on neon-64gb arxiv DB, return stdout. Uses stdin pipe to avoid shell escaping."""
|
||||||
r = subprocess.run(
|
r = subprocess.run(
|
||||||
["ssh", NEON_HOST,
|
["ssh", NEON_HOST,
|
||||||
f"podman exec {CONTAINER} psql -U postgres -d arxiv -t -A -c \"{sql}\""],
|
f"podman exec -i {CONTAINER} psql -U postgres -d arxiv -t -A"],
|
||||||
capture_output=True, text=True, timeout=timeout,
|
input=sql, capture_output=True, text=True, timeout=timeout,
|
||||||
)
|
)
|
||||||
if r.returncode != 0:
|
if r.returncode != 0:
|
||||||
print(f" NEON ERR: {r.stderr[:200]}")
|
print(f" NEON ERR: {r.stderr[:200]}")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue