-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Change get / update dataset metadata to handle two more metadata fields #958
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
Changes from all commits
7631ce9
91f47a9
43232ab
334381e
6a513a3
3c51b38
23ce0cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -338,7 +338,7 @@ def kernel_push(self, kernel_push_request): # noqa: E501 | |
| """ | ||
| with tempfile.TemporaryDirectory() as tmpdir: | ||
| meta_file = os.path.join(tmpdir, "kernel-metadata.json") | ||
| (fd, code_file) = tempfile.mkstemp("code", "py", tmpdir, text=True) | ||
| fd, code_file = tempfile.mkstemp("code", "py", tmpdir, text=True) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. j/w - did you do these formatting changes manually? I know that @stevemessick has some autoformatting set up in this repo, so just want to make sure we're not messing with that.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep, this is from the tooling. it came from something i did notice is that if someone else uses i used the docker one because i assumed it was the way we keep it consistent. but, the docker python version is a bit outdated. so i'm guessing what happened is someone used the linter w/local python instead of docker one time, and it slipped in. |
||
| fd.write(json.dumps(kernel_push_request.code)) | ||
| os.close(fd) | ||
| with open(meta_file, "w") as f: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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 is the internal field name. open to better alternatives.
I had wanted to just call it
sources, but given we follow the Data Package format as much as possible, it conflicts with their "sources". which are objects that have aTitle(required) andPath(optional): https://specs.frictionlessdata.io//data-package/#sourcesHowever,
DatasetVersion.UserSpecifiedSourcesis a markdown string, so that's not feasible to turn into an array of objects and back, without some heavy assumptions that could be wrong (comma separation, etc).It seemed like too much work atm to refactor how we store
UserSpecifiedSourcesto use a collection of objects just for this, so i went with a name that was significantly deviated from the Data Package spec to make it clear it's something else.Open to other suggestions.
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.
@goeffthomas for your thoughts here, given you mentioned Data Package adherence
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.
Thanks for laying all of that out. +1 to your assessment and naming. I think my earlier comment about adhering and using this property was before knowing how they recommend extending. So yeah, if we want something that more matches how we let users specify the sources, this all makes sense to me.
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.
Thanks for the feedback! SG, i'll continue on this way to match our UI