My Testcode:
import sys
from flow.record import RecordDescriptor, RecordStreamWriter
TestRecord1 = RecordDescriptor(
"test/csv_test1",
[
("string", "field11"),
("string", "field12"),
("string", "field13"),
("dictlist", "field14")
]
)
rec1 = TestRecord1(
field11 = "AB",
field12 = "CD",
field13 = "EF",
field14 = {
"Name": "George",
"Surname": "Washington"
}
)
record_writer = RecordStreamWriter(sys.stdout.buffer)
record_writer.write(rec1)
How to run the code:
python3 tests/test-records.py | rdump
Expected output:
[reading from stdin]
<test/csv_test1 field11='AB' field12='CD' field13='EF' field14={'Name': 'George', 'Surname': 'Washington'}>
Actual output:
[reading from stdin]
<test/csv_test1 field11='AB' field12='CD' field13='EF' field14=['Name', 'Surname']>
Suggested Fix
Change to code in
|
class dictlist(list, FieldType): |
to
class dictlist(dict, FieldType):
My Testcode:
How to run the code:
python3 tests/test-records.py | rdumpExpected output:
Actual output:
Suggested Fix
Change to code in
flow.record/flow/record/fieldtypes/__init__.py
Line 195 in f2606d1
to