alteryx / alteryx/woodwork

Force removal of Woodwork schema before allowing re-initialization of Woodwork

Open
#1,188 0 comments 0 reactions 0 assignees View on GitHub
new feature
Dominant language
Python
Stars
155
Forks
24
PR merge metrics
No merged PRs in 30d

Description

- As a user, I wish I Woodwork would not automatically overwrite a DataFrame's typing information if I try reinitializing Woodwork on it.

Currently in Woodwork, doing `df.ww.init` on a dataframe that already has Woodwork typing information on it will overwrite that typing information. In order to avoid that, users need to remember to do the following check:

```python
if df.ww.schema is None:
df.ww.init()
```
This means that it would not be difficult to accidentally overwrite woodwork typing info. In places where Woodwork is used extensively, this can start getting difficult to keep track of.

If Woodwork were to not allow `init` to be called on an object that already has a Woodwork schema, then this would solve that problem. For users who specifically _do_ want to reinit Woodwork, they can choose to remove the Woodwork typing info prior to initialization:

```python
if df.ww.schema is not None:
del df.ww
df.ww.init()
```
If the schema wasn't removed, we could raise a `WoodworkAlreadyInitError` or something of the sort.

This change would make Woodwork re-initialization an opt-in practice rather than one you need to opt out of. However, as this change impacts libraries that depend on Woodwork, like Featuretools and EvalML, we should confirm that this behavior wouldn't create undue complexity in those downstream libraries.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.