@malloydata/malloy 0.0.56-dev230710210433 → 0.0.56-dev230710210438
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -358,11 +358,7 @@ class MalloyToAST extends AbstractParseTreeVisitor_1.AbstractParseTreeVisitor {
|
|
|
358
358
|
}
|
|
359
359
|
visitSQLSourceName(pcx) {
|
|
360
360
|
const name = this.getModelEntryName(pcx.sqlExploreNameRef());
|
|
361
|
-
|
|
362
|
-
if (this.m4WarningsEnabled()) {
|
|
363
|
-
this.astError(res, '`from_sql` is deprecated; use `connection_name.sql(...)` as a source directly', 'warn');
|
|
364
|
-
}
|
|
365
|
-
return res;
|
|
361
|
+
return this.astAt(new ast.FromSQLSource(name), pcx);
|
|
366
362
|
}
|
|
367
363
|
visitSqlSource(pcx) {
|
|
368
364
|
const connId = pcx.connectionId();
|
|
@@ -2937,18 +2937,6 @@ describe('sql expressions', () => {
|
|
|
2937
2937
|
}
|
|
2938
2938
|
expect(m).toTranslateWithWarnings('`sql:` statement is deprecated, use `connection_name.sql(...)` instead');
|
|
2939
2939
|
});
|
|
2940
|
-
test('from_sql deprecation warning', () => {
|
|
2941
|
-
const m = new test_translator_1.TestTranslator(`##! m4warnings
|
|
2942
|
-
sql: bad_sql is {select: """SELECT 1 as one"""}
|
|
2943
|
-
source: foo is from_sql(bad_sql)`);
|
|
2944
|
-
const req = m.translate().compileSQL;
|
|
2945
|
-
if (req) {
|
|
2946
|
-
m.update({
|
|
2947
|
-
compileSQL: { [req.name]: getSelectOneStruct(req) },
|
|
2948
|
-
});
|
|
2949
|
-
}
|
|
2950
|
-
expect(m).toTranslateWithWarnings('`sql:` statement is deprecated, use `connection_name.sql(...)` instead', '`from_sql` is deprecated; use `connection_name.sql(...)` as a source directly');
|
|
2951
|
-
});
|
|
2952
2940
|
test('reference to sql expression in run', () => {
|
|
2953
2941
|
const m = new test_translator_1.TestTranslator(`
|
|
2954
2942
|
run: bigquery.sql("""select 1 as one""")
|