|
|
@ -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"),
|
|
|
|
)
|
|
|
|
)
|
|
|
|