Code Monkey home page Code Monkey logo

Comments (11)

tpendragon avatar tpendragon commented on June 9, 2024 3

Putting it to a vote: 👍 for returning the ID vs a file, 👎 to return the File.

from valkyrie.

carrickr avatar carrickr commented on June 9, 2024

Rather than return the full file, what about the file_path? That would give the option to test for .exist? or other operations. If something wanted the file they could then use the path to go load it and incur the expense.

from valkyrie.

tpendragon avatar tpendragon commented on June 9, 2024

The File object being returned doesn't mean the content is loaded in. In fact, for most adapters it delegates to an internal IO object which probably hasn't read anything, yeah?

from valkyrie.

jcoyne avatar jcoyne commented on June 9, 2024

Perhaps there is more than just the file body? Could there be metadata (filename, mime-type) that would get loaded from somewhere?

from valkyrie.

tpendragon avatar tpendragon commented on June 9, 2024

I do wonder if we should standardize on a metadata attribute on File.

from valkyrie.

tpendragon avatar tpendragon commented on June 9, 2024

I don't think we want to return file_path because not everything has a path (S3/In-Memory). We could just return the file ID - but returning the File just feels so nice.

from valkyrie.

escowles avatar escowles commented on June 9, 2024

As long as the File doesn't need to be expensive, I think returning the File is nicer than returning the ID.

from valkyrie.

tpendragon avatar tpendragon commented on June 9, 2024

Vote!

from valkyrie.

escowles avatar escowles commented on June 9, 2024

Not just for this, I wish there was an :ambivalent: emoji response

from valkyrie.

bmquinn avatar bmquinn commented on June 9, 2024

Not too many votes here, maybe this needs more discussion? I'd rather not be the deciding vote without having a strong preference either way 😄

from valkyrie.

tpendragon avatar tpendragon commented on June 9, 2024

Closing until this shows that returning a File in a specific case would be either too hard to implement or too expensive to be realistic.

from valkyrie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.