Skip to content

How to tell if Accessor is Registered #32330

Open
@achapkowski

Description

@achapkowski

I have a simple question:

How do you know if your accessor namespace has already been registered with the extension framework?

Let's say I do:

import pandas as pd
import coolaccessor # registers dataframe accessor/namespace

Now later on in the code, a person does:

def cool_function(a,b):
   import coolaccessor
   return pd.cool.shibby(a,b)

It will try to re-register the accessor. This produces a warning during testing if that case occurs. So how can I check that if on re-import the registration doesn't need to occur again?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Accessorsaccessor registration mechanism (not .str, .dt, .cat)Enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions