This commit is contained in:
Chen Xu 2022-07-13 15:05:38 +08:00
Родитель 983e56a3d2
Коммит 0e68de1427
7 изменённых файлов: 95 добавлений и 33 удалений

Просмотреть файл

@ -1,6 +1,6 @@
[package]
name = "feathr"
version = "0.2.8"
version = "0.2.9"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Просмотреть файл

@ -737,23 +737,13 @@ impl TryFrom<EntityLineage> for FeathrProjectImpl {
.relations
.iter()
.filter(|&r| r.edge_type == EdgeType::BelongsTo)
.map(|r| {
(
r.from.to_owned(),
value.guid_entity_map[&r.to].name.to_owned(),
)
})
.map(|r| (r.from.to_owned(), value.guid_entity_map[&r.to].get_name()))
.collect();
let consumes_map: HashMap<Uuid, String> = value
.relations
.iter()
.filter(|&r| r.edge_type == EdgeType::Consumes)
.map(|r| {
(
r.from.to_owned(),
value.guid_entity_map[&r.to].name.to_owned(),
)
})
.map(|r| (r.from.to_owned(), value.guid_entity_map[&r.to].get_name()))
.collect();
let (_, entity) = value
.guid_entity_map
@ -826,7 +816,7 @@ impl TryFrom<EntityLineage> for FeathrProjectImpl {
InputFeature {
id: r.to,
key: k,
feature: value.guid_entity_map[&r.to].name.to_owned(),
feature: value.guid_entity_map[&r.to].get_name(),
is_anchor_feature: value.guid_entity_map[&r.to]
.get_entity_type()
== EntityType::AnchorFeature,

Просмотреть файл

@ -317,3 +317,25 @@ pub enum EntityAttributes {
#[serde(rename = "feathr_derived_feature_v1")]
DerivedFeature(DerivedFeatureAttributes),
}
impl EntityAttributes {
pub fn get_name(&self) -> String {
match self {
EntityAttributes::Project(p) => p.name.clone(),
EntityAttributes::Source(s) => s.name.clone(),
EntityAttributes::Anchor(a) => a.name.clone(),
EntityAttributes::AnchorFeature(a) => a.name.clone(),
EntityAttributes::DerivedFeature(d) => d.name.clone(),
}
}
pub fn get_qualified_name(&self) -> String {
match self {
EntityAttributes::Project(p) => p.qualified_name.clone(),
EntityAttributes::Source(s) => s.qualified_name.clone(),
EntityAttributes::Anchor(a) => a.qualified_name.clone(),
EntityAttributes::AnchorFeature(a) => a.qualified_name.clone(),
EntityAttributes::DerivedFeature(d) => d.qualified_name.clone(),
}
}
}

Просмотреть файл

@ -24,17 +24,26 @@ pub enum EntityType {
DerivedFeature,
}
fn default_version() -> u64 {
1
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Entity {
pub guid: Uuid,
pub name: String,
pub qualified_name: String,
// These 2 fields could be omitted
#[serde(rename = "name", default)]
_name: String,
#[serde(rename = "qualifiedName", default)]
_qualified_name: String,
pub status: String,
pub display_text: String,
#[serde(default)]
pub labels: Vec<String>,
#[serde(flatten)]
pub attributes: EntityAttributes,
#[serde(default = "default_version")]
pub version: u64,
}
@ -58,11 +67,19 @@ impl Entity {
Ok(r.base.key)
} else {
Err(Error::InvalidEntityType(
self.name.to_owned(),
self.get_name(),
self.get_entity_type().clone(),
))
}
}
pub fn get_name(&self) -> String {
self.attributes.get_name()
}
pub fn get_qualified_name(&self) -> String {
self.attributes.get_qualified_name()
}
}
impl TryInto<crate::project::FeathrProjectImpl> for Entity {
@ -146,6 +163,7 @@ pub struct Entities {
#[serde(rename_all = "camelCase")]
pub struct UniqueAttributes {
qualified_name: String,
#[serde(default = "default_version")]
version: u64,
}

54
python/Cargo.lock сгенерированный
Просмотреть файл

@ -63,8 +63,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "azure_core"
version = "0.2.2"
source = "git+https://github.com/windoze/azure-sdk-for-rust.git#3cd197727a4b289ab8e10550a98108269089a8bf"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0e2c7582699a3af9cc8a7bc81259519d8afb8eded1090d4fcd86de3db0eace1"
dependencies = [
"async-trait",
"base64",
@ -83,15 +84,15 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
"thiserror",
"url",
"uuid",
]
[[package]]
name = "azure_identity"
version = "0.3.0"
source = "git+https://github.com/windoze/azure-sdk-for-rust.git#3cd197727a4b289ab8e10550a98108269089a8bf"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a80434580cb2e2a1915b57fbd3655b513c4acf149cfbb85747f91649d48833ae"
dependencies = [
"async-lock",
"async-timer",
@ -99,10 +100,11 @@ dependencies = [
"azure_core",
"base64",
"chrono",
"fix-hidden-lifetime-bug",
"futures",
"http",
"log",
"oauth2",
"reqwest",
"serde",
"serde_json",
"url",
@ -111,8 +113,9 @@ dependencies = [
[[package]]
name = "azure_security_keyvault"
version = "0.2.0"
source = "git+https://github.com/windoze/azure-sdk-for-rust.git#3cd197727a4b289ab8e10550a98108269089a8bf"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd2ff53bbbc3d50d911cf67452473620abd2864a9487efd004298c8396b33941"
dependencies = [
"azure_core",
"base64",
@ -127,8 +130,9 @@ dependencies = [
[[package]]
name = "azure_storage"
version = "0.2.0"
source = "git+https://github.com/windoze/azure-sdk-for-rust.git#3cd197727a4b289ab8e10550a98108269089a8bf"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1a5bc29e999268e618c202f157291930d749f1e4de55e01ecfda3990dd37dc7"
dependencies = [
"RustyXML",
"async-trait",
@ -146,15 +150,15 @@ dependencies = [
"serde_derive",
"serde_json",
"sha2",
"thiserror",
"url",
"uuid",
]
[[package]]
name = "azure_storage_datalake"
version = "0.2.0"
source = "git+https://github.com/windoze/azure-sdk-for-rust.git#3cd197727a4b289ab8e10550a98108269089a8bf"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41971cdf60cf59647979ef373b02ecc156fa126e99730e1674b8595f46797462"
dependencies = [
"async-trait",
"azure_core",
@ -417,7 +421,7 @@ dependencies = [
[[package]]
name = "feathr"
version = "0.2.8"
version = "0.2.9"
dependencies = [
"async-trait",
"azure_core",
@ -449,7 +453,7 @@ dependencies = [
[[package]]
name = "feathrs"
version = "0.2.8"
version = "0.2.9"
dependencies = [
"chrono",
"feathr",
@ -462,6 +466,26 @@ dependencies = [
"tokio",
]
[[package]]
name = "fix-hidden-lifetime-bug"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4ae9c2016a663983d4e40a9ff967d6dcac59819672f0b47f2b17574e99c33c8"
dependencies = [
"fix-hidden-lifetime-bug-proc_macros",
]
[[package]]
name = "fix-hidden-lifetime-bug-proc_macros"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4c81935e123ab0741c4c4f0d9b8377e5fb21d3de7e062fa4b1263b1fbcba1ea"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "fnv"
version = "1.0.7"

Просмотреть файл

@ -1,6 +1,6 @@
[package]
name = "feathrs"
version = "0.2.8"
version = "0.2.9"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Просмотреть файл

@ -84,6 +84,7 @@ spark_config:
# Feathr Job configuration. Support local paths, path start with http(s)://, and paths start with abfs(s)://
# this is the default location so end users don't have to compile the runtime again.
# feathr_runtime_location: wasbs://public@azurefeathrstorage.blob.core.windows.net/feathr-assembly-0.1.0-SNAPSHOT.jar
# Comment this setting out to use official JAR from Maven central
feathr_runtime_location: "wasbs://public@xchfeathrtest4sto.blob.core.windows.net/feathr-assembly-0.4.0.jar"
databricks:
# workspace instance
@ -96,6 +97,7 @@ spark_config:
work_dir: 'dbfs:/feathr_getting_started'
# this is the default location so end users don't have to compile the runtime again.
# feathr_runtime_location: "../../target/scala-2.12/feathr-assembly-0.1.0.jar"
# Comment this setting out to use official JAR from Maven central
feathr_runtime_location: "dbfs:/feathr-assembly-0.4.0.jar"
online_store:
@ -106,6 +108,12 @@ online_store:
ssl_enabled: True
feature_registry:
# For testing
api_endpoint: 'http://localhost:8000/api/v1'
# Official Feathr registry supports API version 1
# api_endpoint: 'https://feathr-sql-registry.azurewebsites.net/api/v1'
# Registry in this repo supports API version 2
# api_endpoint: 'https://feathrregistry.azurewebsites.net/api/v2'
# api_version: 2