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

Collect function #2156

Merged
merged 63 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
53b50bf
Collect function.
anderson-joyle Jan 19, 2024
5e2edba
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Jan 24, 2024
1646d9b
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Jan 29, 2024
452f914
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Jan 30, 2024
0750a34
PA fixes
anderson-joyle Jan 31, 2024
551bde8
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Feb 1, 2024
5438406
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Feb 2, 2024
0a1c124
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Feb 5, 2024
9679476
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Feb 5, 2024
ab4c181
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Feb 22, 2024
b4d96ec
Working on V1 compat.
anderson-joyle Feb 8, 2024
b639a80
Fixing return value when PFx1 is disabled.
anderson-joyle Feb 23, 2024
c0f35b8
Fix.
anderson-joyle Feb 23, 2024
0b94653
Saving progress. IR translator, removing unnacessary PFxV1Disabled te…
anderson-joyle Mar 1, 2024
f79b5ab
Fixes. Rebuild Collect IR based on arguments.
anderson-joyle Mar 4, 2024
a547230
Push after changing git user.name
anderson-joyle Mar 5, 2024
bcb871f
PR feedback.
anderson-joyle Mar 5, 2024
c8a8282
Removing deade code.
anderson-joyle Mar 5, 2024
53a5b07
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Mar 6, 2024
3249eb4
Adding code from https://github.com/microsoft/Power-Fx/pull/2246 sinc…
anderson-joyle Mar 7, 2024
90b12e2
New string resources.
anderson-joyle Mar 8, 2024
07c9a30
Fixing suggestions for Collect function.
anderson-joyle Mar 8, 2024
5f93aed
Moving ISuggestionAwareFunction interface to Core.
anderson-joyle Mar 11, 2024
4057f31
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Apr 15, 2024
026e929
Merging.
anderson-joyle Apr 15, 2024
b427b2d
PR feedback.
anderson-joyle Apr 15, 2024
925051c
Conflict.
anderson-joyle Apr 15, 2024
5f371f3
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Apr 15, 2024
57182be
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Apr 15, 2024
5eb71bc
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Apr 16, 2024
247fda6
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Apr 18, 2024
0351bb2
Conflict merge.
anderson-joyle Apr 18, 2024
5f69568
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Apr 22, 2024
16232b5
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Apr 24, 2024
125ce2c
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Apr 24, 2024
cd5e6da
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Apr 25, 2024
e8a558b
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle May 1, 2024
1d7f868
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle May 2, 2024
4e67b0c
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle May 2, 2024
3067d84
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle May 9, 2024
7b21534
Merging changes.
anderson-joyle May 9, 2024
1fe64b2
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle May 10, 2024
3c9ae8e
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle May 13, 2024
335207c
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle May 21, 2024
bde1d84
Implementing ClearCollect/ClearCollectScalar.
anderson-joyle May 22, 2024
ef12780
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle May 22, 2024
2e1a598
Merge main
anderson-joyle May 29, 2024
5a04764
Fixing Collect return type.
anderson-joyle May 31, 2024
5378be2
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle May 31, 2024
9fdc06c
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Jun 2, 2024
8a68bb0
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Jun 3, 2024
80ed784
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Jun 4, 2024
c9a72b4
Fixes.
anderson-joyle Jun 4, 2024
d9b236b
Adding AnalysisMode flag.
anderson-joyle Jun 5, 2024
022cb6a
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Jun 5, 2024
1e1872d
Adding AnalysisMode to binder config
anderson-joyle Jun 6, 2024
ed1a1ac
Deep mutations of records, squashed (#2457)
gregli-msft Jun 6, 2024
9ef5901
Restore STJ nuget version to 6.0.8 (#2462)
MikeStall Jun 6, 2024
1be2479
Move IMutationCopyField to RecordValue so that other implementations…
MikeStall Jun 7, 2024
91881fb
Merging changes.
anderson-joyle Jun 7, 2024
cb757a3
Main merge.
anderson-joyle Jun 11, 2024
fd98493
PR feedback.
anderson-joyle Jun 13, 2024
3a25eb8
Merge branch 'main' into andersonf/unify/collect-2
anderson-joyle Jun 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ private TexlBinding(
entityName: EntityName,
propertyName: Property?.InvariantName ?? string.Empty,
allowsSideEffects: bindingConfig.AllowsSideEffects,
numberIsFloat: bindingConfig.NumberIsFloat);
numberIsFloat: bindingConfig.NumberIsFloat,
analysisMode: bindingConfig.AnalysisMode);
}

/// <summary>
Expand Down Expand Up @@ -2915,12 +2916,20 @@ public override void Visit(FirstNameNode node)
isConstantNamedFormula = formula.IsConstant;
}
}
else if (lookupInfo.Kind == BindKind.Data)
{
if (lookupInfo.Data is IExternalCdsDataSource or IExternalTabularDataSource)
{
_txb.SetMutable(node, true);
}
else if (lookupInfo.Kind == BindKind.Data)
{
if (lookupInfo.Data is IExternalCdsDataSource or IExternalTabularDataSource)
{
_txb.SetMutable(node, true);
}
else if (lookupInfo.Data is IExternalDataSource ds)
{
_txb.SetMutable(node, ds.IsWritable);
}
}
else if (lookupInfo.Kind == BindKind.ScopeCollection)
{
_txb.SetMutable(node, true);
}
else if (lookupInfo.Kind == BindKind.ScopeCollection)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ internal class BindingConfig

public bool UseThisRecordForRuleScope { get; }

public bool NumberIsFloat { get; }
public bool NumberIsFloat { get; }

public bool AnalysisMode { get; }

public BindingConfig(bool allowsSideEffects = false, bool useThisRecordForRuleScope = false, bool numberIsFloat = false)
public BindingConfig(bool allowsSideEffects = false, bool useThisRecordForRuleScope = false, bool numberIsFloat = false, bool analysisMode = false)
{
AllowsSideEffects = allowsSideEffects;
UseThisRecordForRuleScope = useThisRecordForRuleScope;
NumberIsFloat = numberIsFloat;
NumberIsFloat = numberIsFloat;
AnalysisMode = analysisMode;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ internal class CheckTypesContext

public bool NumberIsFloat { get; }

public bool AnalysisMode { get; }

public CheckTypesContext(Features features, INameResolver nameResolver, string entityName, string propertyName, bool allowsSideEffects, bool numberIsFloat)
{
Features = features;
Expand All @@ -30,6 +32,13 @@ public CheckTypesContext(Features features, INameResolver nameResolver, string e
PropertyName = propertyName;
AllowsSideEffects = allowsSideEffects;
NumberIsFloat = numberIsFloat;
AnalysisMode = true;
}

public CheckTypesContext(Features features, INameResolver nameResolver, string entityName, string propertyName, bool allowsSideEffects, bool numberIsFloat, bool analysisMode)
: this(features, nameResolver, entityName, propertyName, allowsSideEffects, numberIsFloat)
{
AnalysisMode = analysisMode;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

namespace Microsoft.PowerFx.Core.Functions
{
/// <summary>
/// Interface used for TexlFunctions to override the default behavior for intellisense suggestions.
/// </summary>
internal interface ISuggestionAwareFunction
{
// Returns true if it's valid to suggest ThisItem for this function as an argument.
bool CanSuggestThisItem { get; }
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using Microsoft.PowerFx.Core.Entities;
using Microsoft.PowerFx.Core.Types;
using Microsoft.PowerFx.Core.Utils;

Expand Down
10 changes: 6 additions & 4 deletions src/libraries/Microsoft.PowerFx.Core/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,14 @@ internal static class TexlStrings
public static StringGetter PatchArg_Updates = (b) => StringResources.Get("PatchArg_Updates", b);

public static StringGetter AboutCollect = (b) => StringResources.Get("AboutCollect", b);
public static StringGetter CollectDataSourceArg = (b) => StringResources.Get("CollectDataSourceArg", b);
public static StringGetter CollectRecordArg = (b) => StringResources.Get("CollectRecordArg", b);
public static StringGetter CollectArg1 = (b) => StringResources.Get("CollectArg1", b);
public static StringGetter CollectArg2 = (b) => StringResources.Get("CollectArg2", b);

public static StringGetter CollectItemArg = (b) => StringResources.Get("CollectItemArg", b);
public static StringGetter AboutCollect_data_source = (b) => StringResources.Get("AboutCollect_data_source", b);
public static StringGetter AboutCollect_item = (b) => StringResources.Get("AboutCollect_item", b);

public static StringGetter AboutClearCollect = (b) => StringResources.Get("AboutClearCollect", b);
public static StringGetter ClearCollectDataSourceArg = (b) => StringResources.Get("ClearCollectDataSourceArg", b);
public static StringGetter ClearCollectRecordArg = (b) => StringResources.Get("ClearCollectRecordArg", b);

public static StringGetter AboutRemove = (b) => StringResources.Get("AboutRemove", b);
public static StringGetter RemoveDataSourceArg = (b) => StringResources.Get("RemoveDataSourceArg", b);
Expand Down
Loading