Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/vite-4.3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
takegue committed Jul 23, 2023
2 parents bfa81d0 + 8348434 commit 03b656c
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 185 deletions.
40 changes: 23 additions & 17 deletions examples/@default/sandbox/@models/mymodel/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,55 +38,61 @@
"minRelativeProgress": 0.01,
"warmStart": false,
"earlyStop": true,
"inputLabelColumns": [
"label"
],
"dataSplitMethod": "AUTO_SPLIT",
"learnRateStrategy": "LINE_SEARCH",
"initialLearnRate": 0.15,
"optimizationStrategy": "BATCH_GRADIENT_DESCENT",
"calculatePValues": false
"calculatePValues": false,
"enableGlobalExplain": false,
"fitIntercept": true,
"standardizeFeatures": true
},
"trainingStartTime": "1679395011891",
"trainingStartTime": "1690084242490",
"results": [
{
"index": 0,
"durationMs": "1931",
"trainingLoss": 1491.0539770637374,
"durationMs": "1818",
"trainingLoss": 1491.0539770637376,
"learnRate": 0.3
},
{
"index": 1,
"durationMs": "2353",
"trainingLoss": 241.92978201881218,
"durationMs": "1967",
"trainingLoss": 241.92978201881212,
"learnRate": 0.6
},
{
"index": 2,
"durationMs": "2808",
"trainingLoss": 41.69727113362378,
"durationMs": "1798",
"trainingLoss": 41.697271133623744,
"learnRate": 0.6
},
{
"index": 3,
"durationMs": "1995",
"trainingLoss": 7.920357012251938,
"durationMs": "1850",
"trainingLoss": 7.920357012251903,
"learnRate": 0.6
},
{
"index": 4,
"durationMs": "2232",
"trainingLoss": 2.603613218455023,
"durationMs": "1670",
"trainingLoss": 2.603613218455012,
"learnRate": 0.6
}
],
"evaluationMetrics": {
"regressionMetrics": {
"meanAbsoluteError": 1.3283107802514735,
"meanSquaredError": 2.603613218455023,
"meanSquaredLogError": 0.0012176719511574083,
"medianAbsoluteError": 1.0159802433960223,
"meanAbsoluteError": 1.3283107802514682,
"meanSquaredError": 2.603613218455012,
"meanSquaredLogError": 0.0012176719511573831,
"medianAbsoluteError": 1.0159802433960081,
"rSquared": 0.9968441051897515
}
},
"startTime": "2023-03-21T10:36:51.891Z"
"startTime": "2023-07-23T03:50:42.490Z"
}
]
}
94 changes: 47 additions & 47 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"@google-cloud/bigquery": "^6.0.3",
"@types/node": "^20.1.1",
"commander": "^10.0.0",
"commander": "^11.0.0",
"log-update": "^5.0.1",
"p-throttle": "^5.0.0",
"picocolors": "^1.0.0",
Expand All @@ -37,7 +37,7 @@
},
"devDependencies": {
"@tsconfig/strictest": "^2.0.1",
"@vitest/coverage-istanbul": "^0.29.1",
"@vitest/coverage-istanbul": "^0.31.4",
"ts-node": "^10.7.0",
"typescript": "^5.0.4",
"vitest": "^0.31.0",
Expand Down
31 changes: 25 additions & 6 deletions src/commands/cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as fs from 'node:fs';

import { formatLocalfiles } from '../../src/commands/fix.js';
import { pushLocalFilesToBigQuery } from '../../src/commands/push.js';
import { PushContext, pushLocalFilesToBigQuery } from '../../src/commands/push.js';
import { createBundleSQL } from '../../src/commands/bundle.js';
import { pullBigQueryResources } from '../../src/commands/pull.js';

Expand Down Expand Up @@ -36,9 +36,9 @@ export function createCLI() {
)
.argument('[projects...]')
.option(
'--force',
'Force to apply changes such as deletion without confirmation',
false,
'--sweeping-mode <mode>',
'Strategy for undefined/orphans BigQuery resources. option: confirm(default), ignore, rename',
'confirm',
)
.option(
'--label <key:value...>',
Expand Down Expand Up @@ -147,6 +147,22 @@ export function createCLI() {
500,
);

const sweepMode: PushContext['SweepStrategy']['mode'] = (() => {
if(!cmdOptions.sweepingMode) {
return 'confirm'
}
switch (cmdOptions.sweepingMode) {
case 'ignore':
case 'rename_and_7d_expire':
case 'confirm':
case 'force':
return cmdOptions.sweepingMode
default:
// Error for invalid option
throw Error(`Invalid --sweeping-mode option: ${cmdOptions.sweepingMode}`);
}
})();

for (const project of projects) {
const ctx = {
BigQuery: {
Expand All @@ -155,10 +171,13 @@ export function createCLI() {
},
rootPath: rootDir,
dryRun: cmdOptions.dryRun ?? false,
force: cmdOptions.force ?? false,
SweepStrategy: {
mode: sweepMode,
ignorePrefix: 'zorphan__',
},
reporter: cmdOptions.format ?? 'console',
enableDataLineage: cmdOptions.enableDatalineage ?? false,
};
} as PushContext;

const failed = await pushLocalFilesToBigQuery(ctx, jobOption);
if (failed > 0) {
Expand Down
Loading

0 comments on commit 03b656c

Please sign in to comment.