airbyte-source-commcare 0.1.24__tar.gz → 0.1.26__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-source-commcare
3
- Version: 0.1.24
3
+ Version: 0.1.26
4
4
  Summary: Source implementation for Commcare.
5
5
  Home-page: https://airbyte.com
6
6
  License: MIT
@@ -5,7 +5,7 @@ requires = [
5
5
  build-backend = "poetry.core.masonry.api"
6
6
 
7
7
  [tool.poetry]
8
- version = "0.1.24"
8
+ version = "0.1.26"
9
9
  name = "airbyte-source-commcare"
10
10
  description = "Source implementation for Commcare."
11
11
  authors = [
@@ -9,12 +9,13 @@ from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple
9
9
  from urllib.parse import parse_qs
10
10
 
11
11
  import requests
12
+ from flatten_json import flatten
13
+
12
14
  from airbyte_cdk.models import SyncMode
13
15
  from airbyte_cdk.sources import AbstractSource
14
16
  from airbyte_cdk.sources.streams import IncrementalMixin, Stream
15
17
  from airbyte_cdk.sources.streams.http import HttpStream
16
18
  from airbyte_cdk.sources.streams.http.requests_native_auth import TokenAuthenticator
17
- from flatten_json import flatten
18
19
 
19
20
 
20
21
  # Basic full refresh stream
@@ -56,7 +57,6 @@ class CommcareStream(HttpStream, ABC):
56
57
  def request_params(
57
58
  self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_page_token: Mapping[str, Any] = None
58
59
  ) -> MutableMapping[str, Any]:
59
-
60
60
  params = {"format": "json"}
61
61
  return params
62
62
 
@@ -79,7 +79,6 @@ class Application(CommcareStream):
79
79
  def request_params(
80
80
  self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_page_token: Mapping[str, Any] = None
81
81
  ) -> MutableMapping[str, Any]:
82
-
83
82
  params = {"format": "json", "extras": "true"}
84
83
  return params
85
84
 
@@ -123,7 +122,6 @@ class IncrementalStream(CommcareStream, IncrementalMixin):
123
122
  def request_params(
124
123
  self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_page_token: Mapping[str, Any] = None
125
124
  ) -> MutableMapping[str, Any]:
126
-
127
125
  params = {"format": "json"}
128
126
  if next_page_token:
129
127
  params.update(next_page_token)
@@ -136,7 +134,6 @@ class IncrementalStream(CommcareStream, IncrementalMixin):
136
134
 
137
135
 
138
136
  class Case(IncrementalStream):
139
-
140
137
  """
141
138
  docs: https://www.commcarehq.org/a/[domain]/api/[version]/case/
142
139
  """
@@ -167,7 +164,6 @@ class Case(IncrementalStream):
167
164
  def request_params(
168
165
  self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_page_token: Mapping[str, Any] = None
169
166
  ) -> MutableMapping[str, Any]:
170
-
171
167
  # start date is what we saved for forms
172
168
  # if self.cursor_field in self.state else (CommcareStream.last_form_date or self.initial_date)
173
169
  ix = self.state[self.cursor_field]
@@ -234,7 +230,6 @@ class Form(IncrementalStream):
234
230
  def request_params(
235
231
  self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_page_token: Mapping[str, Any] = None
236
232
  ) -> MutableMapping[str, Any]:
237
-
238
233
  # if self.cursor_field in self.state else self.initial_date
239
234
  ix = self.state[self.cursor_field]
240
235
  params = {