Hi! We are having an issue with CI Github. We hav...
# questions
e
Hi! We are having an issue with CI Github. We have kedro project with experimental tracking enabled, so every time it runs something save some information in the DB, which always runs great in local mode. But when it comes to test a minimal pipeline in github actions (just to make sure there are no circular dependencies, etc), it fails since the repo is cloned from a specific commit and not a branch (since it is a CI test, after a PR is opened). The key here is that the run cannot be associated with a branch, this fails:
branch = git.Repo(search_parent_directories=True).a
Is there any way to disable experiment tracking at runtime? Or what would it be a better approach to check if kedro can at least create the graph and detect circular dependencies? Detailed log:
Copy code
Run kedro run --tag tag_dict
As an open-source project, we collect usage analytics. 
We cannot see nor store information contained in a Kedro project. 
You can find out more by reading our privacy notice: 
<https://github.com/kedro-org/kedro-plugins/tree/main/kedro-telemetry#privacy-notice> 
Do you opt into usage analytics?  [y/N]: [10/25/22 20:27:24] WARNING  Failed to confirm consent. No data    plugin.py:210
                             was sent to Heap. Exception:                       
[10/25/22 20:27:24] INFO     Kedro project            session.py:343




Pipelines started

        
        
[10/25/22 20:27:24] INFO     Seeding sklearn, numpy and random   seed_file.py:41
                             libraries with the seed 42                         
                    INFO     Loading data from               data_catalog.py:343
                             'tag_dictionary'                                   
                             (ExcelDataSet)...                                  
[10/25/22 20:27:25] INFO     Running node: create_td:                node.py:327
                             create_td([tag_dictionary]) -> [td]                
                    INFO     Saving data to 'td'             data_catalog.py:382
                             (PickleDataSet)...                                 
                    INFO     Completed 1 out of 1 tasks  sequential_runner.py:85
                    INFO     Pipeline execution completed           runner.py:90
                             successfully.                                      
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /opt/hostedtoolcache/Python/3.8.0/x64/bin/kedro:8 in <module>                │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/kedro/fram │
│ ework/cli/cli.py:211 in main                                                 │
│                                                                              │
│   208 │   """                                                                │
│   209 │   _init_plugins()                                                    │
│   210 │   cli_collection = KedroCLI(project_path=Path.cwd())                 │
│ ❱ 211 │   cli_collection()                                                   │
│   212                                                                        │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/click/core │
│ .py:1130 in __call__                                                         │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/kedro/fram │
│ ework/cli/cli.py:139 in main                                                 │
│                                                                              │
│   136 │   │   )                                                              │
│   137 │   │                                                                  │
│   138 │   │   try:                                                           │
│ ❱ 139 │   │   │   super().main(                                              │
│   140 │   │   │   │   args=args,                                             │
│   141 │   │   │   │   prog_name=prog_name,                                   │
│   142 │   │   │   │   complete_var=complete_var,                             │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/click/core │
│ .py:1055 in main                                                             │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/click/core │
│ .py:1657 in invoke                                                           │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/click/core │
│ .py:1404 in invoke                                                           │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/click/core │
│ .py:760 in invoke                                                            │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/kedro/fram │
│ ework/cli/project.py:366 in run                                              │
│                                                                              │
│   363 │   node_names = _get_values_as_tuple(node_names) if node_names else n │
│   364 │                                                                      │
│   365 │   with KedroSession.create(env=env, extra_params=params) as session: │
│ ❱ 366 │   │   session.run(                                                   │
│   367 │   │   │   tags=tag,                                                  │
│   368 │   │   │   runner=runner(is_async=is_async),                          │
│   369 │   │   │   node_names=node_names,                                     │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/kedro/fram │
│ ework/session/session.py:293 in __exit__                                     │
│                                                                              │
│   290 │   def __exit__(self, exc_type, exc_value, tb_):                      │
│   291 │   │   if exc_type:                                                   │
│   292 │   │   │   self._log_exception(exc_type, exc_value, tb_)              │
│ ❱ 293 │   │   self.close()                                                   │
│   294 │                                                                      │
│   295 │   def run(  # pylint: disable=too-many-arguments,too-many-locals     │
│   296 │   │   self,                                                          │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/kedro/fram │
│ ework/session/session.py:285 in close                                        │
│                                                                              │
│   282 │   │   if `save_on_close` attribute is True.                          │
│   283 │   │   """                                                            │
│   284 │   │   if self.save_on_close:                                         │
│ ❱ 285 │   │   │   self._store.save()                                         │
│   286 │                                                                      │
│   287 │   def __enter__(self):                                               │
│   288 │   │   return self                                                    │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/kedro_viz/ │
│ integrations/kedro/sqlite_store.py:68 in save                                │
│                                                                              │
│   65 │   │   engine, session_class = create_db_engine(self.location)         │
│   66 │   │   Base.metadata.create_all(bind=engine)                           │
│   67 │   │   database = next(get_db(session_class))                          │
│ ❱ 68 │   │   session_store_data = RunModel(id=self._session_id, blob=<http://self.to|self.to> │
│   69 │   │   database.add(session_store_data)                                │
│   70 │   │   database.commit()                                               │
│   71                                                                         │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/kedro_viz/ │
│ integrations/kedro/sqlite_store.py:52 in to_json                             │
│                                                                              │
│   49 │   │   │   │   try:                                                    │
│   50 │   │   │   │   │   import git  # pylint: disable=import-outside-toplev │
│   51 │   │   │   │   │                                                       │
│ ❱ 52 │   │   │   │   │   branch = git.Repo(search_parent_directories=True).a │
│   53 │   │   │   │   │   value["branch"] = branch.name                       │
│   54 │   │   │   │   except ImportError as exc:  # pragma: no cover          │
│   55 │   │   │   │   │   logger.warning("%s:%s", exc.__class__.__name__, exc │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/git/repo/b │
│ ase.py:865 in active_branch                                                  │
│                                                                              │
│    862 │   │   :raises TypeError: If HEAD is detached                        │
│    863 │   │   :return: Head to the active branch"""                         │
│    864 │   │   # reveal_type(self.head.reference)  # => Reference            │
│ ❱  865 │   │   return self.head.reference                                    │
│    866 │                                                                     │
│    867 │   def blame_incremental(self, rev: str | HEAD, file: str, **kwargs: │
│    868 │   │   """Iterator for blame information for the given file at the g │
│                                                                              │
│ /opt/hostedtoolcache/Python/3.8.0/x64/lib/python3.8/site-packages/git/refs/s │
│ ymbolic.py:309 in _get_reference                                             │
│                                                                              │
│   306 │   │   │   to a reference, but to a commit"""                         │
│   307 │   │   sha, target_ref_path = self._get_ref_info(self.repo, self.path │
│   308 │   │   if target_ref_path is None:                                    │
│ ❱ 309 │   │   │   raise TypeError("%s is a detached symbolic reference as it │
│   310 │   │   return self.from_path(self.repo, target_ref_path)              │
│   311 │                                                                      │
│   312 │   def set_reference(                                                 │
╰──────────────────────────────────────────────────────────────────────────────╯
TypeError: HEAD is a detached symbolic reference as it points to 
'b508cdadd62cf912ab26104388cef8e08d1066eb'
Error: Process completed with exit code 1.
K 1
🙏 1
m
@Olivia Lihn Hi Maria, can you give us an advice on this error, or do you know someone that can help us ?