From 493de16d477f0745c53fe0fc5a1ed64eb2daa847 Mon Sep 17 00:00:00 2001 From: NEC-Vishal <105697861+NEC-Vishal@users.noreply.github.com> Date: Mon, 28 Nov 2022 10:20:01 +0530 Subject: [PATCH 1/9] Update RELEASE_NOTES.md --- RELEASE_NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index b41d37df..4b97bcc1 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -24,6 +24,7 @@ - Replaced entity with getter (#652) - Resolved TODO in Dockerfile (#680) - Resolved TODO at src/reporter/tests/test_timescale_types.py (#667) +- Resolved TODO at src/wq/ql/flask_utils.py (#707) ### Bug fixes From dc985755b5eb6e36f2e1eb8d3224d86ae7adaea4 Mon Sep 17 00:00:00 2001 From: NEC-Vishal Date: Mon, 28 Nov 2022 05:13:39 +0000 Subject: [PATCH 2/9] pr 707 --- src/wq/ql/flaskutils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wq/ql/flaskutils.py b/src/wq/ql/flaskutils.py index 5647fd4d..57a76383 100644 --- a/src/wq/ql/flaskutils.py +++ b/src/wq/ql/flaskutils.py @@ -9,8 +9,10 @@ def json_array_streamer(xs: Iterable[BaseModel]) -> Iterable[str]: yield '[\n' + print(xs,"===============") for x in xs: json_repr = x.json() + print(json_repr,"----") yield json_repr + ',\n' yield 'null\n]' # TODO how to get rid of the null terminator in an efficient and **simple** From 830b74126f6fe5558595e6c67fc927020853c8b9 Mon Sep 17 00:00:00 2001 From: NEC-Vishal Date: Mon, 28 Nov 2022 05:22:47 +0000 Subject: [PATCH 3/9] new_pr707 --- src/wq/ql/flaskutils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wq/ql/flaskutils.py b/src/wq/ql/flaskutils.py index 57a76383..3d2b5c00 100644 --- a/src/wq/ql/flaskutils.py +++ b/src/wq/ql/flaskutils.py @@ -10,6 +10,8 @@ def json_array_streamer(xs: Iterable[BaseModel]) -> Iterable[str]: yield '[\n' print(xs,"===============") + import pdb + pdb.set_trace() for x in xs: json_repr = x.json() print(json_repr,"----") From 7077832ae0c0cb9549e5c926efecf5642c00a005 Mon Sep 17 00:00:00 2001 From: NEC-Vishal Date: Mon, 28 Nov 2022 05:45:24 +0000 Subject: [PATCH 4/9] new_pr707 --- src/wq/ql/flaskutils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wq/ql/flaskutils.py b/src/wq/ql/flaskutils.py index 3d2b5c00..8474a584 100644 --- a/src/wq/ql/flaskutils.py +++ b/src/wq/ql/flaskutils.py @@ -5,13 +5,14 @@ from flask import Response from pydantic import BaseModel - +import logging def json_array_streamer(xs: Iterable[BaseModel]) -> Iterable[str]: yield '[\n' print(xs,"===============") import pdb pdb.set_trace() + logging.info("===============xs",xs) for x in xs: json_repr = x.json() print(json_repr,"----") From 950004c543f61d745b72a7ec359a6bb67d5dc0bf Mon Sep 17 00:00:00 2001 From: NEC-Vishal Date: Mon, 28 Nov 2022 05:47:18 +0000 Subject: [PATCH 5/9] pr --- src/wq/ql/flaskutils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wq/ql/flaskutils.py b/src/wq/ql/flaskutils.py index 8474a584..5f2ed8cb 100644 --- a/src/wq/ql/flaskutils.py +++ b/src/wq/ql/flaskutils.py @@ -12,7 +12,8 @@ def json_array_streamer(xs: Iterable[BaseModel]) -> Iterable[str]: print(xs,"===============") import pdb pdb.set_trace() - logging.info("===============xs",xs) + logging.info("===============00xs",xs) + print("all ok--") for x in xs: json_repr = x.json() print(json_repr,"----") From f468366897530ac1072547a9820817be53e7e22b Mon Sep 17 00:00:00 2001 From: NEC-Vishal Date: Mon, 28 Nov 2022 10:36:49 +0000 Subject: [PATCH 6/9] resolved todo --- src/wq/ql/flaskutils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/wq/ql/flaskutils.py b/src/wq/ql/flaskutils.py index 5f2ed8cb..a56dc13a 100644 --- a/src/wq/ql/flaskutils.py +++ b/src/wq/ql/flaskutils.py @@ -9,16 +9,10 @@ def json_array_streamer(xs: Iterable[BaseModel]) -> Iterable[str]: yield '[\n' - print(xs,"===============") - import pdb - pdb.set_trace() - logging.info("===============00xs",xs) - print("all ok--") for x in xs: json_repr = x.json() - print(json_repr,"----") yield json_repr + ',\n' - yield 'null\n]' + yield '\n]' # TODO how to get rid of the null terminator in an efficient and **simple** # way? I could use the same put-back approach as in itersplit but I'd rather # keep it simple. From 3cdc1a02807f123ad2864ace32eb4afb972cd2ac Mon Sep 17 00:00:00 2001 From: NEC-Vishal Date: Mon, 28 Nov 2022 10:44:17 +0000 Subject: [PATCH 7/9] remove the null terminator from flask_utils.py --- src/wq/ql/flaskutils.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/wq/ql/flaskutils.py b/src/wq/ql/flaskutils.py index a56dc13a..ca0f1121 100644 --- a/src/wq/ql/flaskutils.py +++ b/src/wq/ql/flaskutils.py @@ -13,9 +13,6 @@ def json_array_streamer(xs: Iterable[BaseModel]) -> Iterable[str]: json_repr = x.json() yield json_repr + ',\n' yield '\n]' -# TODO how to get rid of the null terminator in an efficient and **simple** -# way? I could use the same put-back approach as in itersplit but I'd rather -# keep it simple. def build_json_array_response_stream(xs: Iterable[BaseModel]) -> Response: From c4d063fda3611edc9f2eb90eca239379480e9433 Mon Sep 17 00:00:00 2001 From: NEC-Vishal <105697861+NEC-Vishal@users.noreply.github.com> Date: Mon, 28 Nov 2022 16:20:29 +0530 Subject: [PATCH 8/9] Update RELEASE_NOTES.md --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 4b97bcc1..e33d46e6 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -24,7 +24,7 @@ - Replaced entity with getter (#652) - Resolved TODO in Dockerfile (#680) - Resolved TODO at src/reporter/tests/test_timescale_types.py (#667) -- Resolved TODO at src/wq/ql/flask_utils.py (#707) +- Resolved TODO in src/wq/ql/flask_utils.py (#707) ### Bug fixes From 7c0b4f62fd4110862cb74d755bfd2adca127f7b5 Mon Sep 17 00:00:00 2001 From: NEC-Vishal Date: Mon, 28 Nov 2022 10:52:40 +0000 Subject: [PATCH 9/9] resolved TODO in flaskutils.py --- src/wq/ql/flaskutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wq/ql/flaskutils.py b/src/wq/ql/flaskutils.py index ca0f1121..2d8a870a 100644 --- a/src/wq/ql/flaskutils.py +++ b/src/wq/ql/flaskutils.py @@ -5,7 +5,7 @@ from flask import Response from pydantic import BaseModel -import logging + def json_array_streamer(xs: Iterable[BaseModel]) -> Iterable[str]: yield '[\n'