Hi,
I’m currently running a test of the booking import tool (Import_data.py) on the “lorealfrance” company, ahead of a wider rollout this weekend for a go-live scheduled Monday, August 24th in the morning.
The script authenticates correctly and successfully fetches existing clients, providers, and services. However, it crashes as soon as it tries to create the first booking, with the following error:
AttributeError: 'DataFrame' object has no attribute 'email'
on this line:
python
cid = self.clients[self.clients.email == row. Email]
Like the “lorealfrance” company currently has zero existing clients in Simplybook. In that case, self.get("clients") returns an empty list, and pd.DataFrame([]) produces a DataFrame with no columns at all — so there’s no “email” column to compare against, which crashes the script before it can even create the first client/booking.
This case (brand-new company, 0 existing clients) doesn’t seem to be handled by the current script. Could you please:
- Confirm whether you’ve encountered this before?
- Provide a fixed version of the script (or confirm whether we’re free to patch the
init()method ourselves so the clients DataFrame always has “id” and “email” columns, even when empty)?
Given our tight timeline (go-live Monday, August 24th at 9:30 AM), a quick response would be very helpful.
Thanks in advance,
Loïc