Stéphane Burwash
05/17/2022, 1:12 PMedgar_ramirez_mondragon
05/17/2022, 2:27 PMclass BaseStream(RESTStream):
def get_url_params(self, context, next_page_token):
return {"base": "param"}
class ArchivedStream(BaseStream):
def get_url_params(self, context, next_page_token):
params = super().get_url_params(context, next_page_token)
params["archived"] = True
return params
I think @visch has come up with a way to accomplish this using partitions so you wouldn't need extra classes.Stéphane Burwash
05/17/2022, 2:28 PMedgar_ramirez_mondragon
05/17/2022, 2:30 PM@property
? then yeah, it will be inherited. It's just syntactic sugar for a method without arguments 🙂visch
05/17/2022, 2:31 PMarchived=True
and archived=False
? If the answer to that is No it makes this a lot easier as you can 100% just go with what @edgar_ramirez_mondragon point you to.
If the answer is yes. Then look at https://gitlab.com/meltano/sdk/-/issues/273 https://github.com/AutoIDM/tap-clickup/pull/117/files#diff-4490b7dbe49a82fea4fdf63d08c6c503536d30f56841c428f2998bf03b4b94a2R124-R138 which allows you to use Partitions with Child Streams to create a len(Partitions) * len(ChildStreams)
number of Partitions. There's a few rough edges with it but it works well.visch
05/17/2022, 2:33 PM{
"bookmarks": {
"task": {
"partitions": [
{
"context": {
"team_id": "18011725",
"archived": "true"
},
"replication_key": "date_updated",
"replication_key_value": "1635447757140"
},
{
"context": {
"team_id": "18011725",
"archived": "false"
},
"replication_key": "date_updated",
"replication_key_value": "1650312773788"
},
{
"context": {
"team_id": "18016848",
"archived": "true"
}
},
{
"context": {
"team_id": "18016848",
"archived": "false"
},
"replication_key": "date_updated",
"replication_key_value": "1636847634320"
}
]
}
}
}
(filtered this down a bit to get the point acrossStéphane Burwash
05/17/2022, 2:33 PMStéphane Burwash
05/17/2022, 8:20 PMvisch
05/17/2022, 8:20 PMvisch
05/17/2022, 8:21 PMStéphane Burwash
05/17/2022, 8:21 PMvisch
05/17/2022, 8:21 PMvisch
05/17/2022, 8:22 PMStéphane Burwash
05/17/2022, 8:22 PMStéphane Burwash
05/17/2022, 8:42 PM/bla/bla/?archived=true
and /bla/bla/?archived=false
. How would I go about achieving this?visch
05/17/2022, 8:43 PMvisch
05/17/2022, 8:43 PMvisch
05/17/2022, 8:44 PMparams["archived"] = True
could turn into
params["archived"] = context["archived"]
maybe? Depends on your codeStéphane Burwash
05/17/2022, 8:46 PMvisch
05/17/2022, 8:46 PMvisch
05/17/2022, 8:47 PMvisch
05/17/2022, 8:48 PMStéphane Burwash
05/17/2022, 8:51 PMvisch
05/18/2022, 12:53 PMStéphane Burwash
05/18/2022, 1:00 PMArchivedDealsStream, ArchivedCompaniesStream and ArchivedContacts stream
which I want to delete and replace by partitioning: https://github.com/potloc/tap-hubspot/tree/DE-223-hubspot_v3-introduce-stream-partitionning-to-archived-dataStéphane Burwash
05/18/2022, 1:01 PMvisch
05/18/2022, 1:02 PMStéphane Burwash
05/18/2022, 1:02 PMvisch
05/18/2022, 1:03 PMvisch
05/18/2022, 1:05 PM