Skip to content

feat: NeoWorlder integration to production#287

Merged
preritdas merged 10 commits intomasterfrom
taran/neoworlder-deliverer
Mar 6, 2026
Merged

feat: NeoWorlder integration to production#287
preritdas merged 10 commits intomasterfrom
taran/neoworlder-deliverer

Conversation

@taran-bains
Copy link
Contributor

No description provided.

@augmentcode
Copy link

augmentcode bot commented Mar 2, 2026

🤖 Augment PR Summary

Summary: This PR promotes the NeoWorlder deliverer toward production usage and adds campaign-routing metadata to the exported lead CSVs.

Changes:

  • Adds a `PRODUCTION_BASE_URL` constant alongside the staging URL for explicit environment selection
  • Extends NeoworlderDeliverer initialization with campaign parameters (campaign_type, is_recovery, sms_optin) and validates campaign_type
  • Appends NeoWorlder campaign columns (BUYER, RECOVERY, SMS_OPTIN) to the generated CSV before upload
  • Adds unit tests covering the new init params, invalid campaign types, the production URL constant, and campaign columns in the CSV output

Technical Notes: CSV augmentation currently round-trips through pandas.read_csv/to_csv, so preserving exact CSV formatting/dtypes is important for downstream correctness.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Member

@preritdas preritdas left a comment

Choose a reason for hiding this comment

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

Looks good overall, specific comments throughout the implementation and test file.

Comment on lines +70 to +71
STAGING_BASE_URL = "https://public-api.staging.neoworlder.com"
# PRODUCTION_BASE_URL = "https://public-api.neoworlder.com" # Update when available
PRODUCTION_BASE_URL = "https://public-api.neoworlder.com"
Copy link
Member

Choose a reason for hiding this comment

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

Let's keep this out of the SDK, they should be supplied in keys.yaml from real-intent-deliveries.

PRODUCTION_BASE_URL = "https://public-api.neoworlder.com"

# Valid campaign types for NeoWorlder persona routing
VALID_CAMPAIGN_TYPES = ("seller", "buyer")
Copy link
Member

Choose a reason for hiding this comment

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

Let's use a StrEnum for this, and reference that datatype below in the initializer. Serves both purposes of data validation and documenting available values.

Comment on lines +228 to +244
if csv_string:
reader = csv.reader(io.StringIO(csv_string))
rows = list(reader)

# Append campaign columns to header and data rows
buyer_val = "BUYER" if self.campaign_type == "buyer" else ""
recovery_val = "YES" if self.is_recovery else ""
sms_val = "YES" if self.sms_optin else ""

rows[0].extend(["BUYER", "RECOVERY", "SMS_OPTIN"])
for row in rows[1:]:
row.extend([buyer_val, recovery_val, sms_val])

output = io.StringIO()
writer = csv.writer(output)
writer.writerows(rows)
csv_string = output.getvalue()
Copy link
Member

Choose a reason for hiding this comment

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

In a situation like this I think it makes more sense to use the pattern:

if not csv_string:
    # handle edge case

# main logic unindented

Comment on lines +92 to +94
def test_deliverer_production_url():
"""Test that the production URL constant is available."""
assert NeoworlderDeliverer.PRODUCTION_BASE_URL == "https://public-api.neoworlder.com"
Copy link
Member

Choose a reason for hiding this comment

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

In accordance with prior comment about removing URLs from SDK, would remove this test entirely.

Comment on lines +247 to +248
import pandas as pd
from io import StringIO
Copy link
Member

Choose a reason for hiding this comment

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

Would put these at the root of the test module, not within the function, to fail-fast on test collection vs. test execution. Imports within functions are useful for conditional imports, but io is stdlib and pandas is required by the package at large (I'm pretty sure).

Copy link
Member

Choose a reason for hiding this comment

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

This would apply to all instances of imports within functions.

@preritdas preritdas merged commit 71ff619 into master Mar 6, 2026
1 check passed
@preritdas preritdas deleted the taran/neoworlder-deliverer branch March 6, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants