#30190: json lines (jsonl) serializer
-------------------------------------+-------------------------------------
Reporter: aliva | Owner: nobody
Type: New feature | Status: closed
Component: Core | Version: master
(Serialization) |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by aliva):
Hi
I have started writing tests for jsonl, (I simply copied `test_json` to
`test_jsonl`) and trying to fix issues. there is a problem I'm facing,
when using jsonl output lines can be very long, so what is the preferred
way to pass flake for test data?
* should I add `NOQA: E501` for these lines?
* use this style
{{{
a = """{"key": value",""" \
""""key2": value"}"""
}}}
* use this style
{{{
a = """{
"key": "value"
"ley2: "value2",
}.replace("\n", "")
}}}
also I have added patch 2 which is a work in progress and some tests fail
as a sample here is a sample test data from test_json.py
{{{
mapping_ordering_str = """[
{
"model": "serializers.article",
"pk": %(article_pk)s,
"fields": {
"author": %(author_pk)s,
"headline": "Poker has no place on ESPN",
"pub_date": "2006-06-16T11:00:00",
"categories": [
%(first_category_pk)s,
%(second_category_pk)s
],
"meta_data": []
}
}
]
}}}
It should be like this for jsonl
{{{
mapping_ordering_str = """{"model": "serializers.article", "pk":
%(article_pk)s, fields": {"author": %(author_pk)s, "headline": "Poker has
no place on ESPN", pub_date": "2006-06-16T11:00:00", categories":
[%(first_category_pk)s, %(second_category_pk)s], "meta_data": []}}\n"""
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30190#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/063.6555b473a4c2a0556c2ab20734a4e9e6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.