Hey I got the low code yaml file working nicely, e...
# help-connector-development
j
Hey I got the low code yaml file working nicely, except for one problem, I want to add a transformation and I am not sure where I am going wrong. I added like this with the itention of each record also getting the streamslice.job_id it was collected from, but using the UI to test it, no records are getting this field added. What am I missing?
Copy code
record_selector:
        type: RecordSelector
        extractor:
          type: DpathExtractor
          field_path:
            - data
      transformations:
        - type: AddFields
          fields:
            - path: job_id
              value: '{{ stream_slice.job_id }}'
        - type: RemoveFields
          field_pointers:
              - ["attributes", "first-name"]
              - ["attributes", "last-name" ]
      paginator:
        type: DefaultPaginator
        page_token_option:
          type: RequestPath
        pagination_strategy:
          type: CursorPagination
cursor_value: '{{ response[''links''][''next''] }}'
a
Hi Jon, Do you have a stream slicer that defines a job_id field?
j
This part works for me so yes I think it should be configured requester: type: HttpRequester url_base: https://api.teamtailor.com/ path: /v1/jobs/{{ stream_slice.job_id }}/candidates
This is the definition you are asking for right?
👍 1
parent_stream_configs: - type: ParentStreamConfig parent_key: id partition_field: job_id
The removal doesnt work either, so my guess I have misconfigured the transformations somehow.
a
hard to tell without seeing the full yaml file... is the
transformations
field at the stream level or at the retriever level? from the snippet, it looks like it's at the retriever level. Can you try moving it to the stream as per this schema
j
That is correct and my mistake moving it up to stream probably makes it work however I get: "Could not perform read with with error: Every message grouping should have at least one request and response"
Which I interpret it as if the response was empty then it becomes a bit angry 🙂
Added this to the stream level
Copy code
transformations:
      - type: AddFields
        fields:
          - path: [ "field1" ]
            value: "static_value"
I will run with the data and see if it is useful, otherwise I will convert it to a python connector I guess.
a
are you using the connector builder? If so, what version are you using?
j
Yup trying it out, 0.41.0
Hey follow up question, I got the transformations to work when running spec, check, discover and read and everything is working fine. Then using the schema tool to infer schemas, then I reran pointing at those, everything looked great. However when I push the image to my airbyte server (upgraded to .43) I get the following error message:
Copy code
2023-04-09 07:58:30 INFO i.a.w.g.DefaultReplicationWorker(getReplicationOutput):544 - failures: [ { 
 "failureOrigin" : "replication", 
 "internalMessage" : "No properties node in stream schema", 
 "externalMessage" : "Something went wrong during replication", 
 "metadata" : { 
 "attemptNumber" : 1, 
 "jobId" : 15 
 }, 
 "stacktrace" : "java.lang.RuntimeException: No properties node in stream schema\n\tat io.airbyte.workers.general.DefaultReplicationWorker.populateStreamToAllFields(DefaultReplicationWorker.java:693)\n\tat io.airbyte.workers.general.DefaultReplicationWorker.lambda$readFromSrcAndWriteToDstRunnable$7(DefaultReplicationWorker.java:384)\n\tat java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)\n\tat java.base/java.lang.Thread.run(Thread.java:1589)\n", 
 "timestamp" : 1681027049119 
} ]
Asked chat gpt to validate the schema for me and it said it looked fine as well 🙂 Can post it if needed but a bit confused here.
Update for anyone looking, rewrote the connector in python and now it is working fine so all good.