DEV Community

Cover image for What Did You Learn This Week --March 27?
Waylon Walker
Waylon Walker

Posted on

What Did You Learn This Week --March 27?

What Did you Learn this week --March 27?

Top comments (4)

Collapse
 
waylonwalker profile image
Waylon Walker

🎂 This week was my Birthday!

I learned how to add kedro catalogs together using dictionary unpacking, and submitted a feature request.

[KED-1512] Ability to add catalogs together #302

Description

I am would like to request the ability to add two DataCatalog objects together to get the addition of the two. This will improve the ability to reuse pipelines and catalogs from existing projects.

Example

Let's say I already have two DataCatalogs loaded in c1 and c2. I would like the ability to add them together.

full_catalog = c1 + c2

Context

I am trying to combine pipelines from two different projects. Kedro natively gives me the ability to add the pipelines together, but not the DataCatalog

Possible Implementation

Create a new DataCatalog using dictionary unpacking from the individual DataCatalogs. In the case of duplicates the second catalog will take preference.

def __add__(self, other):
   DataCatalog({**self.__dict__['_data_sets'], **other.__dict__['_data_sets']})
Collapse
 
marklchaves profile image
mark l chaves

Happy birthday week, @waylonwalker !

This week (or late last week), I worked on something that I thought was an interesting requirement. I've seen it come up twice now. There were no takers. So, I thought I'd give it a whirl.

The requirement was to have top-level menu items jump to an accordion further down the page and open the corresponding accordion item. I call it a "remote control" accordion.

Has anyone else seen this requirement? Anyway, here's my solution in plain JavaScript.

codepen.io/marklchaves/pen/oNXyNLQ

Comments are welcome ;-)

Collapse
 
waylonwalker profile image
Waylon Walker

Thanks @marklchaves

Collapse
 
jwp profile image
John Peters • Edited

I learned to thing about Angular directives in a different, more easy way.