Skip to content

Commit

Permalink
source-impact-native: switching snapshots pk to _meta/row_id
Browse files Browse the repository at this point in the history
after fixing the tombstone value with the correct class, the connector still broke
due to tombstone failures. The newer bugs happened because there were still a pk required that was not being fed
to the newer tombstone model. In order to fix that, i've removed all previous pk from snapshot models and fixated
all pks to _meta/row_id ( the default strategy )
  • Loading branch information
Luishfs committed Sep 25, 2024
1 parent 9d75621 commit b9e8e6f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 54 deletions.
19 changes: 5 additions & 14 deletions source-impact-native/source_impact_native/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,15 @@ class Ads(BaseDocument, extra="allow"):
START_DATE_INCREMENTAL: ClassVar[str] = None
END_DATE: ClassVar[str] = ""
REP_KEY: ClassVar[str] = ""
PRIMARY_KEY: ClassVar[str] = "/Id"

Id: str
PRIMARY_KEY: ClassVar[str] = "/_meta/row_id"

class Catalogs(BaseDocument, extra="allow"):
NAME: ClassVar[str] = "Catalogs"
START_DATE: ClassVar[str] = ""
START_DATE_INCREMENTAL: ClassVar[str] = None
END_DATE: ClassVar[str] = ""
REP_KEY: ClassVar[str] = ""
PRIMARY_KEY: ClassVar[str] = "/Id"

Id: str
PRIMARY_KEY: ClassVar[str] = "/_meta/row_id"

class Invoices(BaseDocument, extra="allow"):
NAME: ClassVar[str] = "Invoices"
Expand Down Expand Up @@ -137,9 +133,8 @@ class Campaigns(BaseDocument, extra="allow"):
START_DATE: ClassVar[str] = ""
END_DATE: ClassVar[str] = ""
REP_KEY: ClassVar[str] = ""
PRIMARY_KEY: ClassVar[str] = "/Id"
PRIMARY_KEY: ClassVar[str] = "/_meta/row_id"

Id: str

class Reports(BaseDocument, extra="allow"):
# No query parameters available, and no date replication key
Expand Down Expand Up @@ -167,9 +162,7 @@ class PhoneNumbers(BaseDocument, extra="allow"):
START_DATE: ClassVar[str] = ""
END_DATE: ClassVar[str] = ""
REP_KEY: ClassVar[str] = "DateCreated"
PRIMARY_KEY: ClassVar[str] = "/Id"

Id: str
PRIMARY_KEY: ClassVar[str] = "/_meta/row_id"

class PromoCodes(BaseDocument, extra="allow"):
NAME: ClassVar[str] = "PromoCodes"
Expand Down Expand Up @@ -218,9 +211,7 @@ class MediaPartnerGroups(BaseDocument, extra="allow"):
START_DATE: ClassVar[str] = ""
END_DATE: ClassVar[str] = ""
REP_KEY: ClassVar[str] = ""
PRIMARY_KEY: ClassVar[str] = "/Id"

Id: str
PRIMARY_KEY: ClassVar[str] = "/_meta/row_id"

class Notes(BaseDocument, extra="allow"):
NAME: ClassVar[str] = "Notes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,21 +592,14 @@
"row_id": -1
},
"description": "Document metadata"
},
"Id": {
"title": "Id",
"type": "string"
}
},
"required": [
"Id"
],
"title": "Campaigns",
"type": "object",
"x-infer-schema": true
},
"key": [
"/Id"
"/_meta/row_id"
]
},
{
Expand Down Expand Up @@ -653,21 +646,14 @@
"row_id": -1
},
"description": "Document metadata"
},
"Id": {
"title": "Id",
"type": "string"
}
},
"required": [
"Id"
],
"title": "Ads",
"type": "object",
"x-infer-schema": true
},
"key": [
"/Id"
"/_meta/row_id"
]
},
{
Expand Down Expand Up @@ -714,21 +700,14 @@
"row_id": -1
},
"description": "Document metadata"
},
"Id": {
"title": "Id",
"type": "string"
}
},
"required": [
"Id"
],
"title": "Catalogs",
"type": "object",
"x-infer-schema": true
},
"key": [
"/Id"
"/_meta/row_id"
]
},
{
Expand Down Expand Up @@ -829,21 +808,14 @@
"row_id": -1
},
"description": "Document metadata"
},
"Id": {
"title": "Id",
"type": "string"
}
},
"required": [
"Id"
],
"title": "PhoneNumbers",
"type": "object",
"x-infer-schema": true
},
"key": [
"/Id"
"/_meta/row_id"
]
},
{
Expand Down Expand Up @@ -1134,21 +1106,14 @@
"row_id": -1
},
"description": "Document metadata"
},
"Id": {
"title": "Id",
"type": "string"
}
},
"required": [
"Id"
],
"title": "MediaPartnerGroups",
"type": "object",
"x-infer-schema": true
},
"key": [
"/Id"
"/_meta/row_id"
]
}
]

0 comments on commit b9e8e6f

Please sign in to comment.