Hey Gang! I'm facing an issue related to developin...
# troubleshoot
c
Hey Gang! I'm facing an issue related to developing custom actions and getting Datahub to use these. I've attached my python scripts, as well as Some Notable errors I see when running ####->datahub --debug actions -c custom_action.yaml BTW, I did not see any relevant posts on slack related to this, hopefully this is not just PEBKAT :-)
b
hey Joshua! so that first error you called out where you can't import
EventEnvelope
may be causing all these problems. I took a look at the actions repo and it actually appears like you should be importing
EventEnvelope
from
datahub_actions.event.event_envelope
- can you try changing your imports and see if that works?
i'm looking at our docs now and I see that how you are doing it is the same as in our docs! so if this fixes your problem then I'll know we need to update our docs 🙂
c
Cool, let me try real quick
b
hmmm so i'm seeing this error as well:
ModuleNotFoundError: No module named 'custom_action.custom_action'; 'custom_action' is not a package
so for some reason it doesn't know how to get your custom action. you ran
pip install -e .
inside the module or ran
python setup.py
on your python file?
or you can put your Action in the same directory as your config file and reference it as the module name = the name of the file - ie.
custom_action:CustomAction
i think? Looking at these docs: https://datahubproject.io/docs/actions/guides/developing-an-action#step-2-installing-the-action
c
Hey Chris, I actually did both, I did a pip3 install -e . as well as created a setup.py file. I did NOT actually run the python setup.py command. I will take a look and let you know. Thanks!
That worked! My custom_action.yaml looks like this now...
Copy code
# datagovernance_intake.yaml
name: "custom_action_test"
source:
  type: "kafka"
  config:
    connection:
      bootstrap: ${KAFKA_BOOTSTRAP_SERVER:-localhost:9092}
      schema_registry_url: ${SCHEMA_REGISTRY_URL:-<http://localhost:8081>}

filter:
  event_type: "EntityChangeEvent_v1"
  event:
    category: "TAG"
    operation: ["ADD","REMOVE"]
    modifier: "urn:li:tag:access_request"

action:
  type: "custom_action:CustomAction"
  config:
    # Some sample configuration which should be printed on create.
    config1: value1
and my custom action is running.
b
great news Joshua! so things look like they're going well so far then?
c
Yes, now I will get with the app dev team to insert a sample Jira API call into the custom_action.py script to create an issue whenever someone adds an access_request tag to an entity. Thanks for helping me with this Chris!
b
wonderful! glad to hear it. and of course! i'd love to hear an update as you guys continue working on it and hear how it all goes