Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a blob value / type and tests #2097

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CarlosFigueiraMSFT
Copy link
Contributor

No description provided.

@LucGenetier
Copy link
Contributor

Public API changes:
❌CP0006 M:Microsoft.PowerFx.Types.ITypeVisitor.Visit(Microsoft.PowerFx.Types.BlobType)

@MikeStall
Copy link
Contributor

Issue #1725.
fyi, PAD was also interested in files.


public override string ToString()
{
return "o";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return "o";

?

var evaluator = _engine.Check("Set(b, BlobCreation(\"myid\"))", opts, _symbolTable).GetEvaluator();
var result = await evaluator.EvalAsync(default, _runtimeConfig).ConfigureAwait(false);

// Set() returns constant 'true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Set() returns constant 'true;

unrelated - did we have some change to make this void?

evaluator = _engine.Check("b", opts, _symbolTable).GetEvaluator();
result = await evaluator.EvalAsync(default, _runtimeConfig).ConfigureAwait(false);
var blobValue = result as BlobValue;
Assert.NotNull(blobValue);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: can we just cast? Then we'll get a more meaningful exception?


namespace Microsoft.PowerFx.Types
{
public class BlobValue : PrimitiveValue<string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PrimitiveValue

Changing base class later is a big deal, so we should be confident this is the pattern we want for future scenarios.

@madevoge
Copy link
Contributor

Should we extend IValueVisitor to include BlobValue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants