Given a dataset of user pin interactions, write a Python Pandas script to clean the data, handle missing values, and calculate the rolling 7-day active user count.
For this SQL version, write a PostgreSQL query using the provided tables. Exclude interactions missing a user, pin, or timestamp, and include dates with no valid activity.
activity_date, rolling_7_day_active_users.activity_date ascending.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique Pinterest user identifier |
| display_name | VARCHAR(100) | Optional user display name |
| created_at | DATE | Date the user account was created |
| Column | Type | Description |
|---|---|---|
| interaction_idPK | INT | Unique interaction identifier |
| user_id | INT | User who performed the interaction |
| pin_id | VARCHAR(30) | Identifier of the interacted pin |
| action_type | VARCHAR(20) | Interaction type, such as save or click |
| occurred_at | TIMESTAMP | Timestamp when the interaction occurred |