sheetsync: Move extra metrics columns into a variable

pull/401/head
Mike Lang 3 months ago committed by Mike Lang
parent 37dd7c3e4f
commit 6a9884ee5b

@ -95,6 +95,16 @@ class SheetSync(object):
'state', 'state',
'error', 'error',
} }
# Additional columns to read from the database but not write to the sheet,
# for metrics purposes.
metrics_columns = {
"state",
"error",
"public",
"poster_moment",
"sheet_name",
"category",
}
def __init__(self, name, middleware, stop, dbmanager, reverse_sync=False): def __init__(self, name, middleware, stop, dbmanager, reverse_sync=False):
self.name = name self.name = name
@ -159,9 +169,10 @@ class SheetSync(object):
SELECT {} FROM {} SELECT {} FROM {}
""").format( """).format(
sql.SQL(", ").join(sql.Identifier(col) for col in sql.SQL(", ").join(sql.Identifier(col) for col in
{ "id", "state", "error", "public", "poster_moment", "sheet_name", "category" } {"id"}
| self.input_columns | self.input_columns
| self.output_columns | self.output_columns
| self.metrics_columns
), ),
sql.Identifier("table"), sql.Identifier("table"),
) )

Loading…
Cancel
Save