Hello here, I'm working with the *target-postgres ...
# troubleshooting
c
Hello here, I'm working with the target-postgres variant transferwise. I'm facing an issue where the target-postgres returns a
psycopg2.errors.NotNullViolation: null value in column "id" violates not-null constraint
although I am passing a correct hardcoded value. I've run out of idea to debug that issue. It looks like the message I am passing has all its value replaced by the target by null values but one: Here is the hardcoded value emitted in tap (out):
Copy code
{
  "type": "RECORD",
  "stream": "offices",
  "record": {
    "id": 1234,
    "clientId": 4567,
    "clientName": "clientNameOne",
    "name": "NameOne",
    "address1": "Somewhere",
    "address2": "",
    "number": "8",
    "box": "",
    "zip": "1234",
    "city": "someplace",
    "countryId": 1,
    "telephone": "+123456789",
    "fax": "+987654321",
    "mobile": "",
    "email": "<mailto:email@mail.com|email@mail.com>",
    "website": "<http://somewebsite.com>",
    "vat": "ZH123123123",
    "statusId": 1,
    "updateDateTime": "2021-05-10T07:47:57.053Z",
    "synchronization_date": "2021-09-08 01:23:45.123"
  }
}
And this is the error:
Copy code
psycopg2.errors.NotNullViolation: null value in column "id" violates not-null constraint
target-postgres       | DETAIL:  Failing row contains (null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 2021-09-08 01:23:45.123).
Also, here is the underlying schema:
Copy code
{
  "type": "SCHEMA",
  "stream": "offices",
  "schema": {
    "properties": {
      "Id": {
        "type": [
          "null",
          "integer"
        ]
      },
      "ClientId": {
        "type": [
          "null",
          "integer"
        ]
      },
      "ClientName": {
        "type": [
          "null",
          "string"
        ]
      },
      "Name": {
        "type": [
          "null",
          "string"
        ]
      },
      "Address1": {
        "type": [
          "null",
          "string"
        ]
      },
      "Address2": {
        "type": [
          "null",
          "string"
        ]
      },
      "Number": {
        "type": [
          "null",
          "string"
        ]
      },
      "Box": {
        "type": [
          "null",
          "string"
        ]
      },
      "Zip": {
        "type": [
          "null",
          "string"
        ]
      },
      "City": {
        "type": [
          "null",
          "string"
        ]
      },
      "CountryId": {
        "type": [
          "null",
          "integer"
        ]
      },
      "CountryName": {
        "type": [
          "null",
          "string"
        ]
      },
      "Telephone": {
        "type": [
          "null",
          "string"
        ]
      },
      "Fax": {
        "type": [
          "null",
          "string"
        ]
      },
      "Mobile": {
        "type": [
          "null",
          "string"
        ]
      },
      "Email": {
        "type": [
          "null",
          "string"
        ]
      },
      "Website": {
        "type": [
          "null",
          "string"
        ]
      },
      "Vat": {
        "type": [
          "null",
          "string"
        ]
      },
      "StatusId": {
        "type": [
          "null",
          "integer"
        ]
      },
      "UpdateDateTime": {
        "format": "date-time",
        "type": [
          "null",
          "string"
        ]
      },
      "synchronization_date": {
        "format": "date-time",
        "type": [
          "null",
          "string"
        ]
      }
    }
  },
  "key_properties": [
    "id"
  ]
}
Can you help me out?
Found the issue. The schema was proposing an "*I*d" with capital "*I*" and the data fed was with an "id" ...