Problem
Some downstream scripts still pass a tz keyword argument (e.g., tz="America/New_York") to wrapper functions. db2pq.postgres.update.wrds_update_pg() currently does not accept tz, which causes breakage when callers migrate from older wrappers that tolerated it.
Existing reference behavior (wrds2pg)
In wrds2pg, wrds_update() explicitly accepts tz (default "UTC") and applies it during ingest by setting PostgreSQL session timezone before COPY (SET TimeZone TO '<tz>').
Desired behavior
db2pq should handle tz arguments consistently so downstream update scripts do not need compatibility shims.
Proposed options
- Add optional
tz=None parameter to wrds_update_pg() and wrds_update_pq() and document whether it is currently ignored or applied.
- If unsupported by design, fail with a clear, actionable error message instead of a generic unexpected keyword error.
Acceptance criteria
- Passing
tz does not crash with TypeError: unexpected keyword argument 'tz'.
- Behavior is documented in README/API docs.
- If supported, behavior aligns with the
wrds2pg::wrds_update() model (default UTC, explicit timezone handling semantics).
- Tests cover calls with and without
tz.
Context
This surfaced while simplifying wrds_pg/audit scripts to use upstream regex-based keep/drop handling directly from db2pq.
Problem
Some downstream scripts still pass a
tzkeyword argument (e.g.,tz="America/New_York") to wrapper functions.db2pq.postgres.update.wrds_update_pg()currently does not accepttz, which causes breakage when callers migrate from older wrappers that tolerated it.Existing reference behavior (
wrds2pg)In
wrds2pg,wrds_update()explicitly acceptstz(default"UTC") and applies it during ingest by setting PostgreSQL session timezone before COPY (SET TimeZone TO '<tz>').Desired behavior
db2pqshould handletzarguments consistently so downstream update scripts do not need compatibility shims.Proposed options
tz=Noneparameter towrds_update_pg()andwrds_update_pq()and document whether it is currently ignored or applied.Acceptance criteria
tzdoes not crash withTypeError: unexpected keyword argument 'tz'.wrds2pg::wrds_update()model (default UTC, explicit timezone handling semantics).tz.Context
This surfaced while simplifying
wrds_pg/auditscripts to use upstream regex-basedkeep/drophandling directly fromdb2pq.