Skip to content

Commit 45ffbb9

Browse files
Address review comments
2 parents 28d771c + f27e203 commit 45ffbb9

File tree

1 file changed

+83
-85
lines changed

1 file changed

+83
-85
lines changed

connectors/goshippo/README.md renamed to connectors/goshippo/README.md

Lines changed: 83 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ This connector uses API token authentication to connect to the Goshippo API. The
4545

4646
To obtain your API token:
4747

48-
1. Log in to your Goshippo account.
48+
1. Log in to your [Goshippo account](https://apps.goshippo.com/login?).
4949
2. Go to **Settings > API**.
50-
3. Copy your API token.
50+
3. Copy your API token or generate a new one.
5151
4. Add the API token to the `configuration.json` file.
5252

5353
## Pagination
@@ -61,7 +61,6 @@ The pagination loop continues until the API returns no `next` URL, indicating th
6161
The connector processes shipment data and related entities as follows:
6262

6363
1. Main shipments - The `flatten_shipment()` function extracts and flattens shipment fields including addresses (from, to, return), carrier accounts, and metadata. Nested objects like addresses are flattened into individual columns with prefixes (`from_`, `to_`, `return_`).
64-
6564
2. Related data - The `process_shipment()` function coordinates upserting the main shipment record and its related data:
6665
- Rates - The `process_rates()` function processes shipping rate options including carrier, amount, service level, and estimated delivery days.
6766
- Parcels - The `process_parcels()` function processes parcel dimensions, weight, and metadata.
@@ -73,109 +72,108 @@ The connector uses the `op.upsert()` operation to insert or update records in th
7372

7473
The connector implements comprehensive error handling with retry logic (refer to the `fetch_shipments_page()`, `handle_response_status()`, and `handle_request_exception()` functions):
7574

76-
1. Retry logic - The connector retries requests up to 3 times (`__MAX_RETRIES`) for transient errors including:
75+
- Retry logic - The connector retries requests up to 3 times (`__MAX_RETRIES`) for transient errors including:
7776
- Network timeouts and connection errors
7877
- Rate limiting (HTTP 429)
7978
- Server errors (HTTP 500, 502, 503, 504)
80-
81-
2. Exponential backoff - The `calculate_retry_delay()` function implements exponential backoff with a maximum delay of 60 seconds.
82-
83-
3. Fail fast - The connector immediately raises exceptions for permanent errors like authentication failures (4xx errors) without retrying.
84-
85-
4. Specific exception handling - The connector catches specific exceptions (`RuntimeError`, `requests.RequestException`, `ValueError`, `KeyError`, `requests.Timeout`, `requests.ConnectionError`, `AttributeError`, `IndexError`, `TypeError`) rather than generic exceptions to avoid masking unexpected errors.
79+
- Exponential backoff - The `calculate_retry_delay()` function implements exponential backoff with a maximum delay of 60 seconds.
80+
- Fail fast - The connector immediately raises exceptions for permanent errors like authentication failures (4xx errors) without retrying.
81+
- Specific exception handling - The connector catches specific exceptions (`RuntimeError`, `requests.RequestException`, `ValueError`, `KeyError`, `requests.Timeout`, `requests.ConnectionError`, `AttributeError`, `IndexError`, `TypeError`) rather than generic exceptions to avoid masking unexpected errors.
8682

8783
All errors are logged using the SDK's logging framework before being raised.
8884

8985
## Tables created
9086

91-
The connector creates the following tables in the destination (refer to the `schema()` function):
87+
The connector creates the `SHIPMENT`, `SHIPMENT_RATES`, `SHIPMENT_PARCELS`, and `SHIPMENT_MESSAGES` tables in the destination.
88+
89+
Refer to the `schema()` function for more details.
9290

93-
### shipments
91+
### SHIPMENTS
9492

9593
| Column | Type | Description |
9694
|--------|------|-------------|
97-
| object_id | STRING | Unique identifier for the shipment (Primary Key) |
98-
| object_created | STRING | Timestamp when shipment was created |
99-
| object_updated | STRING | Timestamp when shipment was last updated |
100-
| object_owner | STRING | Owner of the shipment object |
101-
| status | STRING | Current status of the shipment |
102-
| metadata | STRING | Additional metadata |
103-
| shipment_date | STRING | Date of shipment |
104-
| test | STRING | Test mode indicator |
105-
| order | STRING | Associated order ID |
106-
| carrier_accounts | STRING | JSON array of carrier account IDs |
107-
| customs_declaration | STRING | Customs declaration ID |
108-
| alternate_address_to | STRING | JSON object of alternate delivery address |
109-
| from_name | STRING | Sender name |
110-
| from_company | STRING | Sender company |
111-
| from_street1 | STRING | Sender street address |
112-
| from_city | STRING | Sender city |
113-
| from_state | STRING | Sender state |
114-
| from_zip | STRING | Sender ZIP code |
115-
| from_country | STRING | Sender country |
116-
| from_phone | STRING | Sender phone |
117-
| from_email | STRING | Sender email |
118-
| to_name | STRING | Recipient name |
119-
| to_company | STRING | Recipient company |
120-
| to_street1 | STRING | Recipient street address |
121-
| to_city | STRING | Recipient city |
122-
| to_state | STRING | Recipient state |
123-
| to_zip | STRING | Recipient ZIP code |
124-
| to_country | STRING | Recipient country |
125-
| to_phone | STRING | Recipient phone |
126-
| to_email | STRING | Recipient email |
127-
| return_name | STRING | Return address name |
128-
| return_company | STRING | Return address company |
129-
| return_street1 | STRING | Return address street |
130-
| return_city | STRING | Return address city |
131-
| return_state | STRING | Return address state |
132-
| return_zip | STRING | Return address ZIP code |
133-
| return_country | STRING | Return address country |
134-
| return_phone | STRING | Return address phone |
135-
| return_email | STRING | Return address email |
136-
137-
### shipment_rates
95+
| `object_id` | STRING | Unique identifier for the shipment (Primary Key) |
96+
| `object_created` | STRING | Timestamp when shipment was created |
97+
| `object_updated` | STRING | Timestamp when shipment was last updated |
98+
| `object_owner` | STRING | Owner of the shipment object |
99+
| `status` | STRING | Current status of the shipment |
100+
| `metadata` | STRING | Additional metadata |
101+
| `shipment_date` | STRING | Date of shipment |
102+
| `test` | STRING | Test mode indicator |
103+
| `order` | STRING | Associated order ID |
104+
| `carrier_accounts` | STRING | JSON array of carrier account IDs |
105+
| `customs_declaration` | STRING | Customs declaration ID |
106+
| `alternate_address_to` | STRING | JSON object of alternate delivery address |
107+
| `from_name` | STRING | Sender name |
108+
| `from_company` | STRING | Sender company |
109+
| `from_street1` | STRING | Sender street address |
110+
| `from_city` | STRING | Sender city |
111+
| `from_state` | STRING | Sender state |
112+
| `from_zip` | STRING | Sender ZIP code |
113+
| `from_country` | STRING | Sender country |
114+
| `from_phone` | STRING | Sender phone |
115+
| `from_email` | STRING | Sender email |
116+
| `to_name` | STRING | Recipient name |
117+
| `to_company` | STRING | Recipient company |
118+
| `to_street1` | STRING | Recipient street address |
119+
| `to_city` | STRING | Recipient city |
120+
| `to_state` | STRING | Recipient state |
121+
| `to_zip` | STRING | Recipient ZIP code |
122+
| `to_country` | STRING | Recipient country |
123+
| `to_phone` | STRING | Recipient phone |
124+
| `to_email` | STRING | Recipient email |
125+
| `return_name` | STRING | Return address name |
126+
| `return_company` | STRING | Return address company |
127+
| `return_street1` | STRING | Return address street |
128+
| `return_city` | STRING | Return address city |
129+
| `return_state` | STRING | Return address state |
130+
| `return_zip` | STRING | Return address ZIP code |
131+
| `return_country` | STRING | Return address country |
132+
| `return_phone` | STRING | Return address phone |
133+
| `return_email` | STRING | Return address email |
134+
135+
### SHIPMENT_RATES
138136

139137
| Column | Type | Description |
140138
|--------|------|-------------|
141-
| rate_object_id | STRING | Unique identifier for the rate (Primary Key) |
142-
| shipment_object_id | STRING | Associated shipment ID (Primary Key) |
143-
| amount | STRING | Shipping cost amount |
144-
| currency | STRING | Currency code |
145-
| provider | STRING | Shipping carrier provider |
146-
| servicelevel_name | STRING | Service level name |
147-
| servicelevel_token | STRING | Service level token |
148-
| estimated_days | STRING | Estimated delivery days |
149-
| duration_terms | STRING | Duration terms |
150-
| carrier_account | STRING | Carrier account ID |
151-
| object_created | STRING | Timestamp when rate was created |
152-
153-
### shipment_parcels
139+
| `rate_object_id` | STRING | Unique identifier for the rate (Primary Key) |
140+
| `shipment_object_id` | STRING | Associated shipment ID (Primary Key) |
141+
| `amount` | STRING | Shipping cost amount |
142+
| `currency` | STRING | Currency code |
143+
| `provider` | STRING | Shipping carrier provider |
144+
| `servicelevel_name` | STRING | Service level name |
145+
| `servicelevel_token` | STRING | Service level token |
146+
| `estimated_days` | STRING | Estimated delivery days |
147+
| `duration_terms` | STRING | Duration terms |
148+
| `carrier_account` | STRING | Carrier account ID |
149+
| `object_created` | STRING | Timestamp when rate was created |
150+
151+
### SHIPMENT_PARCELS
154152

155153
| Column | Type | Description |
156154
|--------|------|-------------|
157-
| parcel_object_id | STRING | Unique identifier for the parcel (Primary Key) |
158-
| shipment_object_id | STRING | Associated shipment ID (Primary Key) |
159-
| length | STRING | Parcel length |
160-
| width | STRING | Parcel width |
161-
| height | STRING | Parcel height |
162-
| distance_unit | STRING | Unit of distance measurement |
163-
| weight | STRING | Parcel weight |
164-
| mass_unit | STRING | Unit of weight measurement |
165-
| metadata | STRING | Additional metadata |
166-
| object_created | STRING | Timestamp when parcel was created |
167-
| object_updated | STRING | Timestamp when parcel was last updated |
168-
169-
### shipment_messages
155+
| `parcel_object_id` | STRING | Unique identifier for the parcel (Primary Key) |
156+
| `shipment_object_id` | STRING | Associated shipment ID (Primary Key) |
157+
| `length` | STRING | Parcel length |
158+
| `width` | STRING | Parcel width |
159+
| `height` | STRING | Parcel height |
160+
| `distance_unit` | STRING | Unit of distance measurement |
161+
| `weight` | STRING | Parcel weight |
162+
| `mass_unit` | STRING | Unit of weight measurement |
163+
| `metadata` | STRING | Additional metadata |
164+
| `object_created` | STRING | Timestamp when parcel was created |
165+
| `object_updated` | STRING | Timestamp when parcel was last updated |
166+
167+
### SHIPMENT_MESSAGES
170168

171169
| Column | Type | Description |
172170
|--------|------|-------------|
173-
| message_id | STRING | Generated unique identifier (shipment_id_index) (Primary Key) |
174-
| shipment_object_id | STRING | Associated shipment ID |
175-
| source | STRING | Message source |
176-
| code | STRING | Message code |
177-
| text | STRING | Message text |
171+
| `message_id` | STRING | Generated unique identifier (shipment_id_index) (Primary Key) |
172+
| `shipment_object_id` | STRING | Associated shipment ID |
173+
| `source` | STRING | Message source |
174+
| `code` | STRING | Message code |
175+
| `text` | STRING | Message text |
178176

179177
## Additional considerations
180178

181-
The examples provided are intended to help you effectively use Fivetran's Connector SDK. While we've tested the code, Fivetran cannot be held responsible for any unexpected or negative consequences that may arise from using these examples. For inquiries, please reach out to our Support team.
179+
The examples provided are intended to help you effectively use Fivetran's Connector SDK. While we've tested the code, Fivetran cannot be held responsible for any unexpected or negative consequences that may arise from using these examples. For inquiries, please reach out to our Support team.

0 commit comments

Comments
 (0)