Comments (1)
I've also noticed another (related) issue, in that function calls in the jinja templates are incorrectly seen as keywords, so trying to uppercase the SQL results in invalid syntax:
it('does not uppercase keywords in block', () => {
const formatted = formatter('{{ stuff | join(",") }}', {
sql: 'default',
indent: 4,
upper: true,
});
expect(formatted).toBe('{{ stuff | join(",") }}');
})
Results in:
● jinja flavored queries › does not uppercase keywords in block
expect(received).toBe(expected) // Object.is equality
- Expected - 1
+ Received + 3
- {{ stuff | join(",") }}
+ {{ stuff |
+ JOIN(",") }}
+
If we parsed the jinja separately, this would also get solved because we wouldn't attempt to uppercase them.
from dbt-formatter.
Related Issues (17)
- JOIN `ON` statement no new line when expression contains a jinja variable HOT 1
- Top level {% set %} template should have a new line
- Allow user to configure when parenthesis should become an inline block
- reserverd sql words are uppercased within macros HOT 1
- Add binary HOT 1
- Support `.editorconfig`
- Formatter expands => to = > causing snowflake issues HOT 1
- Formatter changes `null end` to `nullend` in case statement HOT 2
- Case statement bug
- Justified "AS" column aliases?
- Each formatting indents the comments more and more
- JSONB and type casting HOT 1
- asin seen as reserved word
- Support for tabs
- Joins with dynamic table name insert extra newline before alias
- Open to PRs? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbt-formatter.