From 461586916e25faa6f798d181776aeb9ac6f26a6c Mon Sep 17 00:00:00 2001 From: anderson-joyle Date: Thu, 7 Mar 2024 09:27:16 -0600 Subject: [PATCH] Simpler version. --- src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs | 5 +---- .../Entities/External/IExternalDataSource.cs | 2 -- .../AssociatedDataSourcesTests/TestDVEntity.cs | 2 -- .../Helpers/TestTabularDataSource.cs | 2 -- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs b/src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs index 4999d2b8da..d989c66859 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Binding/Binder.cs @@ -2882,10 +2882,7 @@ public override void Visit(FirstNameNode node) } else if (lookupInfo.Kind == BindKind.ScopeCollection) { - if (lookupInfo.Data is IExternalDataSource ds) - { - _txb.SetMutable(node, ds.IsWritable); - } + _txb.SetMutable(node, true); } Contracts.Assert(lookupInfo.Kind != BindKind.LambdaField); diff --git a/src/libraries/Microsoft.PowerFx.Core/Entities/External/IExternalDataSource.cs b/src/libraries/Microsoft.PowerFx.Core/Entities/External/IExternalDataSource.cs index e5e184e182..ed7791bb8a 100644 --- a/src/libraries/Microsoft.PowerFx.Core/Entities/External/IExternalDataSource.cs +++ b/src/libraries/Microsoft.PowerFx.Core/Entities/External/IExternalDataSource.cs @@ -19,8 +19,6 @@ internal interface IExternalDataSource : IExternalEntity, IExternalPageableSymbo bool RequiresAsync { get; } - bool IsWritable { get; } - IExternalDataEntityMetadataProvider DataEntityMetadataProvider { get; } DataSourceKind Kind { get; } diff --git a/src/tests/Microsoft.PowerFx.Core.Tests/AssociatedDataSourcesTests/TestDVEntity.cs b/src/tests/Microsoft.PowerFx.Core.Tests/AssociatedDataSourcesTests/TestDVEntity.cs index 55e69e1694..256d5b0eac 100644 --- a/src/tests/Microsoft.PowerFx.Core.Tests/AssociatedDataSourcesTests/TestDVEntity.cs +++ b/src/tests/Microsoft.PowerFx.Core.Tests/AssociatedDataSourcesTests/TestDVEntity.cs @@ -29,8 +29,6 @@ public class AccountsEntity : IExternalEntity, IExternalDataSource public bool IsPageable => true; - public bool IsWritable => true; - DType IExternalEntity.Type => AccountsTypeHelper.GetDType(); IExternalDataEntityMetadataProvider IExternalDataSource.DataEntityMetadataProvider => throw new NotImplementedException(); diff --git a/src/tests/Microsoft.PowerFx.Core.Tests/Helpers/TestTabularDataSource.cs b/src/tests/Microsoft.PowerFx.Core.Tests/Helpers/TestTabularDataSource.cs index 37e39381f2..c3a78e0a19 100644 --- a/src/tests/Microsoft.PowerFx.Core.Tests/Helpers/TestTabularDataSource.cs +++ b/src/tests/Microsoft.PowerFx.Core.Tests/Helpers/TestTabularDataSource.cs @@ -218,8 +218,6 @@ internal TestDataSource(string name, DType schema, string[] keyColumns = null, I IDelegationMetadata IExternalDataSource.DelegationMetadata => DelegationMetadata; - public bool IsWritable => throw new NotImplementedException(); - public bool CanIncludeExpand(IExpandInfo expandToAdd) { throw new NotImplementedException();