-
Notifications
You must be signed in to change notification settings - Fork 64
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
fix(get): Get completely reworked to function better #520
Conversation
Get method written so that it is used by both cmd/ and api/. Follows the new guideline set out by #519, moving nearly all the logic from lib/ to actions/. Logic which is specific to the command-line, selecting parts of a dataset using a path, moved up a level to the cmd/ package. Get can now be used to retrieve info about local and remote datasets, from both command-line and api server. Fixes #509, #479 #397, and possibly others. Clears the way to merging `body` into `get` in a future PR. Breaks ability to `get` multiple datasets at once.
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.
verrrrrrry 👌. Some quick request for comments but this looks great. Mergable once comments are added.
Path: o.Path, | ||
Format: o.Format, | ||
Concise: o.Concise, | ||
// TODO: It is more efficient to only request data in the Path field, but for now |
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.
Glad this is here. We should def get an RFC going around selectors (querying a dataset), dataset pathing, subsets, and _possibly dataset concatenation.
lib/datasets.go
Outdated
|
||
// Select selects details of one or more datasets | ||
func (r *DatasetRequests) Select(p *SelectParams, res *[]byte) (err error) { | ||
// Get a dataset |
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.
It'd be great if this provided a little more detail:
// Get fetches a dataset head (commit, structure, meta, viz, transform) for a given reference
// The returned *repo.DatasetRef.Dataset field will be populated if a dataset is found
@@ -12,6 +12,8 @@ import ( | |||
"github.com/qri-io/qri/repo" | |||
) | |||
|
|||
// TODO: Remove this, move other functions to another file, possibly in lib/. |
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.
erm, I think this should stay for now.
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.
erm, nope, nvm plz ignore
Get method written so that it is used by both cmd/ and api/. Follows the new
guideline set out by #519, moving nearly all the logic from lib/ to actions/.
Logic which is specific to the command-line, selecting parts of a dataset
using a path, moved up a level to the cmd/ package.
Get can now be used to retrieve info about local and remote datasets, from
both command-line and api server. Fixes #509, #479 #397, and possibly others.
Clears the way to merging
body
intoget
in a future PR.Breaks ability to
get
multiple datasets at once.