Skip to content

Conversation

@Jinso-o
Copy link
Contributor

@Jinso-o Jinso-o commented Aug 14, 2025

Description

Updated API to jaffelshop

Related Issues

  • Fixes #...
  • Closes #...
  • Resolves #...

Additional Context

Jinso-o added 10 commits August 7, 2025 16:50
Replace REST demo with DummyJSON users (CORS-safe for Playground)
- Switch from dummyjson to JSONPlaceholder users API
- Add dev_mode=True for better development experience
- Fix function parameter (remove unused dlt parameter)
- Update table references from 'items' to 'users' consistently
- Fix test assertion to expect 10 users instead of 50
- Add write_disposition='replace' to prevent data duplication
- Improve data display with proper return statements
- Changed from users API (jsonplaceholder) to customers API (jaffle-shop)
- Updated resource name from 'users' to 'customers'
- Updated pipeline name from 'users_pipeline' to 'customers_pipeline'
- Updated all table references and test assertions
- Improved response handling with proper yield from pattern
@netlify
Copy link

netlify bot commented Aug 14, 2025

Deploy Preview for dlt-hub-docs ready!

Name Link
🔨 Latest commit 22cea88
🔍 Latest deploy log https://app.netlify.com/projects/dlt-hub-docs/deploys/68b5a0a077342b00088b16e1
😎 Deploy Preview https://deploy-preview-2995--dlt-hub-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- Resolved conflicts in playground.py
- Kept customers pipeline implementation over users pipeline
- Maintained all customers-related changes (API endpoint, resource name, table references)
- Updated with latest upstream changes
- Fixed unused marimo import (auto-removed by ruff)
- Fixed unused variable 'con' by returning it from connect function
- Applied proper code formatting with ruff
- All tests pass locally
@dlt.resource(name="customers")
def fetch_customers():
response = requests.get("https://jaffle-shop.dlthub.com/api/v1/customers")
yield from response.json()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
yield from response.json()
yield response.json()

# NOTE: This line allows your data to be explored in the marimo datasources which is the third item from the top in the left sidebar
con = pipeline.dataset().ibis()
return
return (con,)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you return (con,) here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think marimo adds this if you are in edit mode

Copy link
Contributor

Choose a reason for hiding this comment

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

@Jinso-o just double check if it's not breaking anything

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's basically marimo's way of saying "make this variable available to other cells and the UI"!

def tests(pipeline):
# NOTE: this cell is only needed for testing this notebook on ci
assert pipeline.dataset().users.df().shape[0] == 10
assert pipeline.dataset().customers.df().shape[0] > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

how many customers this endpoint returns? can you use exact number here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

affle-shop API (used in the playground) returns 100 customers. Therefore for the maintenance and sustainability I assumed it would be better to use >0 then being specific with == 100 as jaffle shop might be updated later. If you recommend me to be more specific I would then use range however would it be better to keep simplicity in the code?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I comment the details? or should I leave it so that the playground users can play with it?

Copy link
Contributor

Choose a reason for hiding this comment

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

it looks good, leave it

- Change 'yield from response.json()' to 'yield response.json()' as requested by reviewer
- Add ?limit=100 parameter to API call for consistent results
- Update assertion to expect exactly 100 customers (== 100)
- Addresses feedback from AstrakhantsevaAA in PR dlt-hub#2995
Copy link
Contributor

@AstrakhantsevaAA AstrakhantsevaAA left a comment

Choose a reason for hiding this comment

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

LGTM!

@Jinso-o Jinso-o merged commit 9e42cbd into dlt-hub:devel Sep 1, 2025
39 checks passed
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.

3 participants