Skip to content

Commit 19aba3e

Browse files
committed
Remove unused parameters
1 parent 910814f commit 19aba3e

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ This hook handles the authentication and request to Intercom. Based on [python-i
1414
This operator composes the logic for this plugin. It fetches the intercom specified object and saves the result in a S3 Bucket, under a specified key, in
1515
njson format. The parameters it can accept include the following.
1616

17-
`intercom_conn_id`: The intercom connection id from Airflow
18-
`intercom_obj`: Intercom object to query
19-
`intercom_method`: *optional* Method from python-intercom.
20-
`s3_conn_id`: S3 connection id from Airflow.
21-
`s3_bucket`: The output s3 bucket.
22-
`s3_key`: The input s3 key.
23-
`output`: Name of the temporary file where the results should be saved
24-
`fields`: *optional* list of fields that you want to get from the object. If *None*, then this will get all fields for the object
25-
`replication_key`: *optional* name of the replication key, if needed.
26-
`replication_key_value`: *(optional)* value of the replication key, if needed. The operator will import only results with the property from replication_key grater than the value of this param.
27-
`intercom_method`: *(optional)* method to call from python-intercom. Default to "all".
28-
`**kwargs`: replication key and value, if replication_key parameter is given and extra params for intercom method if needed.
17+
- `intercom_conn_id`: The intercom connection id from Airflow
18+
- `intercom_obj`: Intercom object to query
19+
- `intercom_method`: *optional* Method from python-intercom.
20+
- `s3_conn_id`: S3 connection id from Airflow.
21+
- `s3_bucket`: The output s3 bucket.
22+
- `s3_key`: The input s3 key.
23+
- `fields`: *optional* list of fields that you want to get from the object. If *None*, then this will get all fields for the object
24+
- `replication_key`: *optional* name of the replication key, if needed.
25+
- `replication_key_value`: *(optional)* value of the replication key, if needed. The operator will import only results with the property from replication_key grater than the value of this param.
26+
- `intercom_method`: *(optional)* method to call from python-intercom. Default to "all".
27+
- `**kwargs`: replication key and value, if replication_key parameter is given and extra params for intercom method if needed.

operators/intercom_to_s3_operator.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class IntercomToS3Operator(BaseOperator):
1313
"""
1414
Make a query against Intercom and write the resulting data to s3.
1515
"""
16+
template_field = ('s3_key', )
1617

1718
@apply_defaults
1819
def __init__(
@@ -23,7 +24,6 @@ def __init__(
2324
s3_conn_id='',
2425
s3_bucket='',
2526
s3_key='',
26-
output='',
2727
fields=None,
2828
replication_key_name=None,
2929
replication_key_value=0,
@@ -39,9 +39,7 @@ def __init__(
3939
:param s3_conn_id: name of the Airflow connection that has
4040
your Amazon S3 conection params
4141
:param s3_bucket: name of the destination S3 bucket
42-
:param s3_key: name of the destination file from bucket
43-
:param output: name of the temporary file where the results
44-
should be saved
42+
:param s3_key: name of the destination file from bucket
4543
:param fields: *(optional)* list of fields that you want
4644
to get from the object.
4745
If *None*, then this will get all fields
@@ -68,7 +66,6 @@ def __init__(
6866
self.s3_conn_id = s3_conn_id
6967
self.s3_bucket = s3_bucket
7068
self.s3_key = s3_key
71-
self.output = output
7269

7370
self.fields = fields
7471
self.replication_key_name = replication_key_name
@@ -147,7 +144,7 @@ def execute(self, context):
147144
dest_s3 = S3Hook(s3_conn_id=self.s3_conn_id)
148145
dest_s3.load_file(
149146
filename=tmp.name,
150-
key=self.output,
147+
key=self.s3_key,
151148
bucket_name=self.s3_bucket,
152149
replace=True
153150

0 commit comments

Comments
 (0)