Skip to content

Commit a871d61

Browse files
committed
fix children key
1 parent d305f1d commit a871d61

File tree

1 file changed

+8
-5
lines changed
  • scraper_service/shovel_extrinsics

1 file changed

+8
-5
lines changed

scraper_service/shovel_extrinsics/utils.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ def get_column_type(value, value_type=None, key=None):
3434
inner = value[0]
3535
# Only use Array if the inner value will have a proper type, otherwise, just
3636
# stringify it.
37-
if isinstance(inner, str) or isinstance(inner, int) or isinstance(inner, float):
37+
if (
38+
isinstance(inner, str)
39+
or isinstance(inner, int)
40+
or isinstance(inner, float)
41+
):
3842
return f"Array({get_column_type(inner)})"
3943
else:
4044
return "String"
@@ -72,7 +76,8 @@ def get_column_type(value, value_type=None, key=None):
7276
"info__twitter__Raw0": "String",
7377
"info__web__Raw0": "String",
7478
"calls": "Array(String)",
75-
"call__call_args": "Array(String)"
79+
"call__call_args": "Array(String)",
80+
"children": "Array(Tuple(UInt64, String))",
7681
}
7782

7883

@@ -122,9 +127,7 @@ def create_clickhouse_table(table_name, column_names, column_types):
122127
)
123128
column_definitions = ", ".join(columns)
124129

125-
order_by = [
126-
"call_module", "call_function", "timestamp", "extrinsic_index"
127-
]
130+
order_by = ["call_module", "call_function", "timestamp", "extrinsic_index"]
128131

129132
sql = f"""
130133
CREATE TABLE IF NOT EXISTS {table_name} (

0 commit comments

Comments
 (0)