Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ NEW: Add
NeedsLookUpTableBuilder
#961base: master
Are you sure you want to change the base?
✨ NEW: Add
NeedsLookUpTableBuilder
#961Changes from 45 commits
bdc4d77
37deab7
4095a0d
b144bc3
0af5175
c9a10fd
db592c0
99dc2dd
9452708
9d6badf
adfc885
02e65be
5199edc
d4e4f04
390dd36
7177c03
61dcbef
98030a8
25d42f0
994b6b1
4f5d185
78aedd7
e86bb39
3a0f270
c6f0c2d
4babb2d
4cec93b
09b14ca
0230f3d
271f6a6
036c723
d3e0f90
e144909
d229036
4ead31a
c6723ea
d0e7849
2faeec3
3d32679
de90ff2
569d5a6
830c12a
a93f75f
ff74834
b69da59
27bd083
c77162c
5fdcd3c
fd1f612
6649155
c3bb82c
0a20d81
4472aed
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add this part (dict creation + json.dump) also to NeedsList as
write_json_lut
?It's easier to maintain if all storage functions are defined in one place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should stay with
add_need
(instead ofadd_lut_need
) and transform the needed data in a special writer functionwrite_json_lut
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be consistent with
build_json
andbuild_json_per_id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was a little different.
Instead of adding a custom data structure and use the same writer-function, we could keep the data structure with
add_need()
and just do the output specific formating in a new writer function likewrite_lut_json
.In this case all the code is the same, till it comes to write it to the harddisk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we keep formatting JSON and only map need["docname"] = need["external_url"] if need["is_external"] = True, It is easy to reuse flow generate need_lut.json like need.json. Otherwise, I will continue change formatting in write_lut_json like {[id] : [docname] or [external_url]}
@r-o-b-e-r-t-o @danwos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nhatnamnguyengtvthcm Not sure if I got your point. But I think we must have a mapping for internal and external needs because otherwise you would not be redirected correctly by permalink.html in case an external need is referenced.