Skip to content

example(connector_sdk) : re-raised new connector#39

Open
fivetran-JenasVimal wants to merge 20 commits into
mainfrom
re-raise_people-ai
Open

example(connector_sdk) : re-raised new connector#39
fivetran-JenasVimal wants to merge 20 commits into
mainfrom
re-raise_people-ai

Conversation

@fivetran-JenasVimal

@fivetran-JenasVimal fivetran-JenasVimal commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description of Change

Re-raising this connector from old repo

RD-1237871

Testing

This is actively being used by a customer. Also, tested locally this morning here
image

Checklist

Some tips and links to help validate your PR:

  • Tested the connector with fivetran debug command.
  • Added/Updated example specific README.md file, refer here for template.
  • Followed Python Coding Standards, refer here

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new people_ai Connector SDK example (ported from an older repo) that authenticates to the People.ai API via OAuth2 client credentials, paginates through activities endpoints, and upserts results into destination tables.

Changes:

  • Added people_ai/connector.py implementing OAuth token acquisition, retry/backoff, pagination, and upserts.
  • Added people_ai/README.md documenting usage, configuration, and produced tables.
  • Added people_ai/configuration.json template plus a (currently empty) people_ai/requirements.txt.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 22 comments.

File Description
people_ai/connector.py Implements the People.ai API sync logic (auth, pagination, retries, upserts, checkpointing).
people_ai/README.md Documents connector behavior, setup, configuration parameters, and tables.
people_ai/configuration.json Provides placeholder configuration keys for API credentials.
people_ai/requirements.txt Added file intended for dependencies (currently empty).

Comment thread people_ai/requirements.txt Outdated
Comment thread people_ai/README.md Outdated
Comment thread people_ai/README.md Outdated
Comment thread people_ai/README.md
Comment thread people_ai/connector.py
Comment thread people_ai/README.md
Comment thread people_ai/README.md
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/connector.py Outdated
except requests.exceptions.HTTPError as e:
# The retry logic is now inside get_page,
# so an error here means it failed permanently
log.severe(f"Permanent failure fetching base activities" f" at offset {offset}: {e}")
Comment thread people_ai/connector.py Outdated

@fivetran-sahilkhirwal fivetran-sahilkhirwal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good
For tests, please rebase after this is merged: #30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 24 comments.

Comment thread people_ai/requirements.txt Outdated
Comment thread people_ai/README.md Outdated
Comment thread people_ai/README.md Outdated
Comment thread people_ai/README.md Outdated
Comment thread people_ai/README.md
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/README.md
Copilot AI review requested due to automatic review settings July 3, 2026 08:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 23 comments.

Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/README.md Outdated
Comment thread people_ai/README.md Outdated
Comment thread people_ai/README.md
Comment thread people_ai/README.md Outdated
Comment thread people_ai/README.md Outdated
Copilot AI review requested due to automatic review settings July 3, 2026 08:12
@fivetran-rishabhghosh fivetran-rishabhghosh removed the request for review from a team July 3, 2026 08:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 22 comments.

Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.

Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Copilot AI review requested due to automatic review settings July 7, 2026 10:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.

Comment thread README.md Outdated
Comment thread people_ai/README.md Outdated
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py Outdated
Comment thread people_ai/connector.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 7, 2026 10:52
fivetran-JenasVimal and others added 4 commits July 7, 2026 16:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py Outdated
Copilot AI review requested due to automatic review settings July 7, 2026 10:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
Comment thread people_ai/connector.py
@fivetran-JenasVimal

Copy link
Copy Markdown
Contributor Author

Was unable to test this as I dont have credentials .

Verified the People.ai endpoints are valid/routable. The activity endpoints return 401 Authentication exception without credentials, which confirms the routes exist and require auth rather than returning 404. The token endpoint returns 405 Method Not Allowed for GET, but returns 401 Invalid credentials for the expected POST form request with dummy credentials, matching the connector’s OAuth client credentials flow.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

Comment thread people_ai/connector.py
Returns:
int: The total number of records successfully processed (upserted).
"""
offset = 0
Comment thread people_ai/connector.py
if len(page) < limit:
break

offset += limit
Comment thread people_ai/connector.py
Comment on lines +357 to +363
state["activity_offset"] = offset + len(page)
op.checkpoint(state)

if len(page) < limit:
break

offset += limit
Comment thread people_ai/connector.py
Comment on lines +191 to +193
except Exception as e:
log.error(f"Failed to refresh token: {e}")
raise e # If re-auth fails, raise the exception
Comment thread people_ai/connector.py
Comment on lines +269 to +274
# Save the progress by checkpointing the state. This is important for ensuring that the sync process can resume
# from the correct position in case of next sync or interruptions.
# Learn more about how and where to checkpoint by reading our best practices documentation
# (https://fivetran.com/docs/connectors/connector-sdk/best-practices#largedatasetrecommendation).
state["activity_offset"] = offset + len(page)
op.checkpoint(state)
Comment thread people_ai/connector.py
Comment on lines +401 to +404
required_configs = ["api_key", "api_secret"]
for key in required_configs:
if key not in configuration:
raise ValueError(f"Missing required configuration value: {key}")
Comment thread people_ai/connector.py
Comment on lines +437 to +441
try:
access_token = get_access_token(api_key, api_secret)
except requests.exceptions.RequestException as e:
log.error(f"FATAL: Initial authentication failed: {e}")
return # Stop the sync
Comment thread README.md
- **[oura_ring](https://github.com/fivetran/community_connectors/tree/main/oura_ring)** - This example shows how to sync health and wellness data from the Oura Ring API v2 using Connector SDK. It syncs daily activity, sleep, readiness, stress, and heart rate data with incremental syncing, cursor-based pagination, automatic flattening of nested contributor objects, and date-range chunking for high-volume heart rate data. You need to provide your Oura Personal Access Token for this example to work.
- **[owasp_api_vulns](https://github.com/fivetran/community_connectors/tree/main/owasp_api_vulns)** - Sync OWASP API vulnerability data from NVD 2.0
- **[partech](https://github.com/fivetran/community_connectors/tree/main/partech)** - Sync POS data from Partech (formerly Punchh)
- **[people_ai](https://github.com/fivetran/community_connectors/tree/main/people_ai)** - Sync activity and participant data from People.ai using OAuth2 client credentials
Comment thread people_ai/connector.py
try:
access_token = get_access_token(api_key, api_secret)
except requests.exceptions.RequestException as e:
log.error(f"FATAL: Initial authentication failed: {e}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we silently skipping here? We need to fail if we are unable to authenticate. On line 188, we call this method and assign the return value to : current_token = reauth_func()
Instead should we directly fail?

Comment thread people_ai/connector.py
the specified activity type.
"""
state_offset_key = f"{activity_type}_offset"
offset = state.get(state_offset_key, 0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key read here is different than the key that is being checkpointed on line 357, how is it consistent?

@fivetran-satvikpatil

Copy link
Copy Markdown

@codex review

@fivetran-satvikpatil fivetran-satvikpatil left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address all the comments given by the copilot/codex.

Comment thread people_ai/README.md
- `schema()` defines the `participants` table with primary key `uid`, `email`.
- `sync_base_activities()` copies each base activity record and renames a `subject` field to `api_subject` when present.
- `sync_activity_type()` writes participant records to the `participants` table.
- The connector stores the most recently processed page offsets in `state["activity_offset"]` and `state["participants_offset"]` after each successful page write.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are we using state["participants_offset"]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants