question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Way to retrieve value of properties in `pipe`

See original GitHub issue

To execute a method of an object, I can do something like:

# Executes the `describe` method of `mtcars`
mtcars >> pipe(_.describe())

However, when I want to retrieve a property of an object, this does not work:

# Want to get `mtcars.columns`
mtcars >> pipe(_.columns)
█─'__call__'
├─█─.
│ ├─_
│ └─'columns'
└─     mpg  cyl   disp   hp  drat     wt   qsec  vs  am  gear  carb
  0   21.0    6  160.0  110  3.90  2.620  16.46   0   1     4     4
  1   21.0    6  160.0  110  3.90  2.875  17.02   0   1     4     4
  2   22.8    4  108.0   93  3.85  2.320  18.61   1   1     4     1
[...]

The closest I could get was:

mtcars >> pipe(lambda _: _.columns)
Index(['mpg', 'cyl', 'disp', 'hp', 'drat', 'wt', 'qsec', 'vs', 'am', 'gear',
       'carb'],
      dtype='object')

But it would be really cool to retrieve properties directly from the Symbolic instance.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
machowcommented, Apr 30, 2021

Hey–thanks for raising. I get bit by this pretty regularly, and its a quick fix! I opened a PR, and will merge later today 😃.

(Will take a closer look at your comments on piping issues. It feels like a few pipe changes would go a long way.)

0reactions
machowcommented, Jun 21, 2021

Sorry for the wait–should be available in v0.0.25!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to extract a property from an observable using a pipe
I'm trying to store an OrderState object in my ngrx store. The problem I have is extracting data from this to my UI....
Read more >
Getting all the Properties of a selected Pipe in Plant3d using ...
Getting all the Properties of a selected Pipe in Plant3d using C#.NET ; CommandMethod · "GetPipingProperties")] ; Editor ed = AcadApp.
Read more >
How to use PowerShell Objects and Data Piping - Varonis
The following will extract each line of the input file and transform it via the pscustomobject command into a property name (as required...
Read more >
Transforming Data Using Pipes - Angular
Implement the PipeTransform interface in your custom pipe class to perform the transformation. Angular invokes the transform method with the value of a...
Read more >
How to Use PowerShell Where-Object to Filter All the Things
In PowerShell, you'll find a few different containment operators: -contains / -ccontains – Filter a collection containing a property value. - ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found