Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekrekr committed Jan 3, 2025
1 parent 3aa6cbe commit 756c813
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions core/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export class Session {
return "";
}

// TODO(ekrekr): safely make this handle parameters more similarly to publish().
// TODO(ekrekr): safely allow passing of config blocks as the second argument, similar to publish.
public operate(
name: string,
queries?: Contextable<ICommonContext, string | string[]>
Expand All @@ -270,9 +270,6 @@ export class Session {
let newTable: Table | IncrementalTable | View = new View(this, { type: "view", name });
if (!!queryOrConfig) {
if (typeof queryOrConfig === "object") {
// if (queryOrConfig?.type === undefined) {
// // Default to type view for `publish` when there's a config but type isn't specified.
// newTable = new Table(this, { type: "table", name, ...queryOrConfig });
if (queryOrConfig?.type === "table" || queryOrConfig.type === undefined) {
newTable = new Table(this, { type: "table", name, ...queryOrConfig });
} else if (queryOrConfig?.type === "incremental") {
Expand All @@ -292,7 +289,7 @@ export class Session {
return newTable;
}

// TODO(ekrekr): safely make this handle parameters more similarly to publish().
// TODO(ekrekr): safely allow passing of config blocks as the second argument, similar to publish.
public assert(name: string, query?: AContextable<string>): Assertion {
const assertion = new Assertion();
assertion.session = this;
Expand All @@ -305,7 +302,7 @@ export class Session {
return assertion;
}

// TODO(ekrekr): safely make this handle parameters more similarly to publish().
// TODO(ekrekr): safely allow passing of config blocks as the second argument, similar to publish.
public declare(dataset: dataform.ITarget): Declaration {
const declaration = new Declaration();
declaration.session = this;
Expand Down

0 comments on commit 756c813

Please sign in to comment.