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.

[API] Should encode() overwrite or update?

See original GitHub issue

Consider this:

layer = Layer(data)
layer.encode(x='Horsepower')
layer.encode(y='Miles_per_Gallon')

Currently, this result is identical to

Layer(data).encode(y='Miles_per_Gallon')

this is because every time encode is called, it overwrites the current encoding.

I think it might be less confusing to change encode so that it instead updates the encoding, such that the above would be equivalent to

layer = Layer(data).encode(
   x='Horsepower',
   y='Miles_per_Gallon'
)

Thoughts?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ellisonbgcommented, May 21, 2016

I think if someone is iterating on a single Layer during exploration, it is very likely they will want to re-encode a single channel. Because of this, we shouldn’t warn upon re-encoding a channel.

0reactions
jakevdpcommented, May 21, 2016

closed by #103

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's the best way to overwrite a file using fs in node.js
Found the solution. fs.writeFileSync gets a third arguments for options that can be an object. So if you get the "File already exist"...
Read more >
Use a mapping template to override an API's request and ...
Learn how to override a an API's request and response parameters and status codes.
Read more >
Files: update | Drive API - Google Developers
Updates a file's metadata and/or content. When calling this method, only populate fields in the request that you want to modify. When updating...
Read more >
Azure API Management transformation policies | Microsoft Learn
Reference for the transformation policies available for use in Azure API Management. Provides policy usage, settings, and examples.
Read more >
PATCH - HTTP - MDN Web Docs
The HTTP PATCH request method applies partial modifications to a resource. ... then a PUT will naturally overwrite it (since it overwrites ...
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