-
Notifications
You must be signed in to change notification settings - Fork 162
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
Handling for Data Preparation actions #1789
Conversation
…ration YAML into the proto representation of the operation.
config.filename = resolveActionsConfigFilename(config.filename, configPath); | ||
const dataPreparationContents = nativeRequire(config.filename).asJson; | ||
const dataPreparationDefinition = parseDataPreparationDefinitionJson(dataPreparationContents); | ||
this.proto.dataPreparation = dataPreparationDefinition; |
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.
Because of protobufjs weirdness, it's better to do:
this.proto.dataPreparation = dataPreparationDefinition; | |
this.proto.dataPreparation = dataform.DataPreparation.create(dataPreparationDefinition); |
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.
The parseDataPreparationDefinitionJson
method already returns this dataform.DataPreparation
entity.
core/actions/data_preparation.ts
Outdated
// If true, adds the inline assertions of dependencies as direct dependencies for this action. | ||
public dependOnDependencyAssertions: boolean = false; |
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.
Supporting this complicates things, and requires a lot more testing area - I'd recommended just not supporting this 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.
Sounds good, I'll remove this for the time being.
core/main_test.ts
Outdated
@@ -858,6 +892,123 @@ defaultNotebookRuntimeOptions: | |||
}); | |||
}); | |||
|
|||
suite("data_preparations", () => { |
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.
Nit:
suite("data_preparations", () => { | |
suite("data preparations", () => { |
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.
Updated
core/main_test.ts
Outdated
@@ -57,6 +57,40 @@ class TestConfigs { | |||
|
|||
const EMPTY_NOTEBOOK_CONTENTS = '{ "cells": [] }'; | |||
|
|||
const DATA_PREPARATION_CONTENTS = ` |
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.
Nit: move this under the suite, or because there's only one test, put it in there.
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.
Moved.
core/session.ts
Outdated
|
||
public dataPreparation(name: string): DataPreparation { | ||
const dataPreparation = new DataPreparation(); | ||
dataPreparation.session = this; | ||
utils.setNameAndTarget(this, dataPreparation.proto, name); | ||
dataPreparation.proto.fileName = utils.getCallerFile(this.rootDir); | ||
this.actions.push(dataPreparation); | ||
return dataPreparation; | ||
} | ||
|
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 would remove method for support in the JS API - this new method isn't covered under any tests as it is
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.
Removed
message DataPreparation { | ||
// Data preparatiohs can have more than 1 output | ||
// Used ONLY as an identifiers. All outputs should be listed in the targets | ||
// section. | ||
Target target = 8; | ||
Target canonical_target = 9; | ||
|
||
// Data preparations can have more than 1 output |
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.
These should be put in the configs.proto
file too, or they won't be user overrideable
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.
Given that the data preparation is self-containing, I don't think this is something that we should allow the user to override.
Add logic to handle Data preparation definitions and parse data preparation YAML into the proto representation of the operation.