Skip to content

Commit

Permalink
refactor(strm-2708): minor stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
bvdeenen committed Oct 24, 2023
1 parent 422df9f commit 123b0bc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.getstrm.pace.common

import build.buf.gen.getstrm.api.data_policies.v1alpha.DataPolicy
import com.getstrm.pace.domain.SqlParseException
import headTailFold
import org.jooq.* // ktlint-disable no-wildcard-imports
import org.jooq.conf.ParseNameCase
Expand Down
10 changes: 0 additions & 10 deletions app/src/main/kotlin/com/getstrm/pace/common/Exceptions.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class SnowflakeClient(
}

override suspend fun applyPolicy(dataPolicy: DataPolicy) {
val statement = SnowflakeDynamicViewGenerator(dataPolicy).toDynamicViewSQL().replace("\\n".toRegex(), "\\\\n")
val statement = SnowflakeDynamicViewGenerator(dataPolicy).toDynamicViewSQL()
.replace("\\n".toRegex(), "\\\\n")
.replace("""(\\\d)""".toRegex(), """\\\\""" + "\$1")
val statementCount = statement.mapNotNull { element -> element.takeIf { it == ';' } }.size.toString()
val request = SnowflakeRequest(
statement = statement,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.getstrm.pace.common

import com.getstrm.pace.util.TestDynamicViewGenerator
import build.buf.gen.getstrm.api.data_policies.v1alpha.DataPolicy
import com.getstrm.pace.domain.SqlParseException
import io.kotest.matchers.shouldBe
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
Expand Down
2 changes: 0 additions & 2 deletions scripts/pp/upsert-data-policy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ data_policy=$(json-case $f)
request=$(echo '{}' | jq -r --argjson p "$data_policy" '{data_policy: $p}')

echo $request | evans -r cli \
--header "authorization=Bearer $(strm auth print-access-token)" \
--host api.dev.getstrm.io --tls --port 443 \
--package getstrm.api.data_policies.v1alpha --service DataPolicyService \
call UpsertDataPolicy

0 comments on commit 123b0bc

Please sign in to comment.