Skip to content

Commit 68bad2a

Browse files
committed
chore: review comments
1 parent 58a9e5b commit 68bad2a

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

processor/internal/transformer/destination_transformer/destination_transformer.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func (d *Client) sendBatch(ctx context.Context, url string, labels types.Transfo
229229
return nil, nil
230230
}
231231
start := time.Now()
232-
compactRequestPayloads := d.compactRequestPayloads() // consistent state for the entire request
232+
compactRequestPayloads := d.config.compactionSupported // consistent state for the entire request
233233
// Call remote transformation
234234
rawJSON, err := d.getRequestPayload(data, compactRequestPayloads)
235235
if err != nil {
@@ -431,10 +431,6 @@ func (c *Client) canRunWarehouseTransformations(destType string) bool {
431431
return false
432432
}
433433

434-
func (d *Client) compactRequestPayloads() bool {
435-
return (d.config.compactionSupported)
436-
}
437-
438434
func (d *Client) getRequestPayload(data []types.TransformerEvent, compactRequestPayloads bool) ([]byte, error) {
439435
if compactRequestPayloads {
440436
ctr := types.CompactedTransformRequest{

router/transformer/transformer.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func (trans *handle) Transform(transformType string, transformMessage *types.Tra
167167
start := time.Now()
168168
var destinationJobs types.DestinationJobs
169169
transformMessageCopy, preservedData := transformMessage.Dehydrate()
170-
compactRequestPayloads := trans.compactRequestPayloads() // consistent state for the entire request
170+
compactRequestPayloads := trans.compactionSupported // consistent state for the entire request
171171

172172
rawJSON, err := trans.getRequestPayload(transformMessageCopy, compactRequestPayloads)
173173
if err != nil {
@@ -785,10 +785,6 @@ func getEndpointFromURL(urlStr string) string {
785785
return ""
786786
}
787787

788-
func (trans *handle) compactRequestPayloads() bool {
789-
return (trans.compactionSupported)
790-
}
791-
792788
func (trans *handle) getRequestPayload(data *types.TransformMessageT, compactRequestPayloads bool) ([]byte, error) {
793789
if compactRequestPayloads {
794790
return jsonrs.Marshal(data.Compacted())

router/transformer/transformer_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,20 +2064,3 @@ func TestTransformerMetrics(t *testing.T) {
20642064
}
20652065
}
20662066
}
2067-
2068-
func TestTransformerCompactionFlags(t *testing.T) {
2069-
t.Run("compaction not supported", func(t *testing.T) {
2070-
h := &handle{
2071-
compactionSupported: false,
2072-
}
2073-
2074-
require.False(t, h.compactRequestPayloads())
2075-
})
2076-
2077-
t.Run("compaction supported ", func(t *testing.T) {
2078-
h := &handle{
2079-
compactionSupported: true,
2080-
}
2081-
require.True(t, h.compactRequestPayloads())
2082-
})
2083-
}

0 commit comments

Comments
 (0)