Cookbook APIs - #29
Merged
Merged
Conversation
srblum
reviewed
Mar 22, 2023
srblum
left a comment
There was a problem hiding this comment.
Generally ok, but please review grammar/spelling for documentation, and add docstrings to methods.
| dt = Client("demo") | ||
|
|
||
| # Run | ||
| runs = dt.get_top_results('recipe_group_id', 1) |
There was a problem hiding this comment.
I think this method and the current value method should have "cookbook" in the name somewhere.
|
|
||
| return fields | ||
|
|
||
| def get_cookbooks(self, **kwargs): |
There was a problem hiding this comment.
Please add docstrings for these functions, akin to the docstring in get_data_v1 above (copied below). Docstrings are helpful because they show up automatically when you call help(cli.get_cookbooks) in the python REPL.
"""
Main data fetching function for all the entities. Note this is the general data fetch function. You probably want to use the model-specific functions such as get_cycles().
:param ename: Name of the entities
:param util_name: Name of the utility function
:param normalize: Flatten nested data structures
:return: pandas dataframe
"""
| We will go over each key in more detail | ||
|
|
||
| ## _count | ||
| The number of total runs. |
There was a problem hiding this comment.
The number of total records in the run.
| The number of total runs. | ||
|
|
||
| ## _count_muted | ||
| The number of runs muted. |
There was a problem hiding this comment.
The number of records filtered out in the run.
| A list of the constraints on this run | ||
|
|
||
| ## cookbook | ||
| The id of the cookbook this run relates to? |
| The name of the field used for the constraint. | ||
|
|
||
| #### type | ||
| The data type of the constraint, mostly commonly continuous or categorical |
| The wieght you are putting on this outcome as compared to the others. | ||
|
|
||
| #### optimization_func | ||
| How you wish to optimize this field usually 'maximize' or 'minize' |
| "filters": {'duration': {'isEnabled': False, 'minimum': 0, 'unit': 'second'}, 'recordFilters': []}, | ||
| "dateRange": {'value': {'relativeAmount': 7, 'relativeUnit': 'day'}, 'config': {'mode': 'relative', 'selectableRelativeUnits': ['minute', 'hour', 'day', 'week', 'month', 'year'], 'enableTimeTypeSelection': True, 'showQuarterShortcuts': True}} | ||
| "computeDeployedDateRange": None, | ||
| "statsCalculationSetting": "defualt", |
| The time the cookbook was last updated. | ||
|
|
||
| ## assets | ||
| A list of assets used in the cookbook? |
| This is used by the frontend UI and can be safely ignored for our purposes. | ||
|
|
||
| ### statsCalculationSetting | ||
| How the recipe group runs calculations? Can be set to defualt? |
srblum
approved these changes
Mar 22, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.