Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.

Commit 05920c6

Browse files
author
Sourcery AI
committed
'Refactored by Sourcery'
1 parent 7299676 commit 05920c6

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

realtime/transformers.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242

4343

4444
def convert_change_data(columns, records, options={}):
45-
result = {}
4645
skip_types = options.get("skip_types") if options.get(
4746
"skip_types") == "undefined" else []
48-
for key in records.keys():
49-
result[key] = convert_column(key, columns, records, skip_types)
50-
return result
47+
return {
48+
key: convert_column(key, columns, records, skip_types)
49+
for key in records.keys()
50+
}
5151

5252

5353
def convert_column(column_name, columns, records, skip_types):
@@ -60,7 +60,7 @@ def convert_column(column_name, columns, records, skip_types):
6060

6161
def convert_cell(_type: str, string_value: str):
6262
try:
63-
if string_value == None:
63+
if string_value is None:
6464
return None
6565
# If data type is an array
6666
if _type[0] == "_":
@@ -185,8 +185,7 @@ def to_array(string_value: str, type: str):
185185
# if string is empty (meaning the array was empty), an empty array will be immediately returned
186186
string_array = string_enriched.split(
187187
",") if len(string_enriched) > 0 else []
188-
array = list(map(lambda string: convert_cell(type, string), string_array))
189-
return array
188+
return list(map(lambda string: convert_cell(type, string), string_array))
190189

191190

192191
"""

0 commit comments

Comments
 (0)