Download scripts/mark_superseded.py from minhbe65/RAG-api: direct link, hf CLI and curl.
- Browser
- Download file 582 Bytes
-
https://huggingface.co/spaces/minhbe65/RAG-api/resolve/main/scripts/mark_superseded.py
- Command line
-
hf download hf://spaces/minhbe65/RAG-api/scripts/mark_superseded.py
-
curl -L -o mark_superseded.py https://huggingface.co/spaces/minhbe65/RAG-api/resolve/main/scripts/mark_superseded.py
582 Bytes
| """Đánh dấu BLLĐ 2012 hết hiệu lực khi BLLĐ 2019 có hiệu lực (2021-01-01).""" | |
| from sqlalchemy import text | |
| from app.db.base import engine | |
| with engine.begin() as c: | |
| n = c.execute( | |
| text( | |
| "UPDATE legal_node SET effective_to='2021-01-01' " | |
| "WHERE doc_id='blld2012' AND effective_to IS NULL" | |
| ) | |
| ).rowcount | |
| c.execute( | |
| text( | |
| "UPDATE legal_document SET expired_date='2021-01-01', status='expired' " | |
| "WHERE doc_id='blld2012'" | |
| ) | |
| ) | |
| print("blld2012 nodes marked expired:", n) | |