Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
waralexrom committed Feb 11, 2025
1 parent 4b6cb93 commit 2526c57
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,12 @@ describe('SQL Generation', () => {
cube('visitor_checkins', {
sql: \`
select * from visitor_checkins WHERE
\${FILTER_PARAMS.visitor_checkins.created_at.filter('created_at')} AND
\${FILTER_GROUP(FILTER_PARAMS.visitor_checkins.created_at.filter("(created_at - INTERVAL '3 DAY')"), FILTER_PARAMS.visitor_checkins.source.filter('source'))}
select visitor_checkins.* from visitor_checkins left join visitors on visitor_checkins.visitor_id = visitors.id WHERE
\${FILTER_PARAMS.visitor_checkins.created_at.filter('visitor_checkins.created_at')} AND
\${FILTER_GROUP(FILTER_PARAMS.visitor_checkins.created_at.filter("(visitor_checkins.created_at - INTERVAL '3 DAY')"), FILTER_PARAMS.visitor_checkins.source.filter('visitor_checkins.source'))}
AND \${SECURITY_CONTEXT.source.filter('visitors.source')} AND
\${SECURITY_CONTEXT.sourceArray.filter(sourceArray => \`visitors.source in (\${sourceArray.join(',')})\`)}
\`,
sql_alias: \`vc\`,
Expand Down Expand Up @@ -1072,7 +1075,7 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
});
});

it('filter join 1', async () => {
it('filter join', async () => {
await compiler.compile();

const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
Expand Down Expand Up @@ -1692,7 +1695,7 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
});
});

it('security context 1', async () => {
it('security context', async () => {
await compiler.compile();

const query = new PostgresQuery({ joinGraph, cubeEvaluator, compiler }, {
Expand Down Expand Up @@ -1868,7 +1871,7 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
]));

it(
'contains filter 1',
'contains filter',
() => runQueryTest({
measures: [],
dimensions: [
Expand Down Expand Up @@ -2663,7 +2666,7 @@ SELECT 1 AS revenue, cast('2024-01-01' AS timestamp) as time UNION ALL
]
));

it('rank measure 1', async () => runQueryTest(
it('rank measure', async () => runQueryTest(
{
measures: ['visitors.revenue_rank'],
},
Expand Down

0 comments on commit 2526c57

Please sign in to comment.